home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / nistimex.zip / nistime.man < prev    next >
Text File  |  1993-06-12  |  6KB  |  149 lines

  1. Name
  2.    nistime -- compare time of local clock with NIST time server
  3.  
  4. Syntax
  5.    nistime  [ options ]
  6.  
  7. Description
  8.    This program connects to the daytime service on the NIST time
  9.    server time_a.timefreq.bldrdoc.gov using tcp/ip port 13.  The 
  10.    time server returns the current time which is then compared 
  11.    with the time of the local clock. The difference may be used to 
  12.    adjust the time of the local clock.
  13.  
  14.    NISTIME uses the timezone information set in the TZ variable to 
  15.    convert from UTC to local time.  Copy the value from one of your 
  16.    UNIX systems or create form "set TZ=CST6CDT" where the 6 represents
  17.    number of hours from UTC (6 for Central Time in the US).  Default
  18.    if no TZ is set is EST5EDT, Eastern Standard Time.
  19.  
  20. Options
  21.    -m0        Do not display the received time message.  Only the 
  22.         time difference in seconds is written to the standard
  23.         output.  A positive value for the difference means 
  24.         that the local clock is fast with respect to NIST.
  25.  
  26.    -m1 or -M    Display short time messages.
  27.  
  28.    -m2        Display longer time messages.
  29.  
  30.    -s0        Do not set the local clock.
  31.  
  32.    -s1 or -S    Set the local clock if the server is healthy.
  33.  
  34.    -s2        Set the local clock even if the server is not healthy.
  35.  
  36.    -s3        Query operator before setting the clock. 
  37.  
  38.     If no options are used, the default is -M -s3, but these
  39. defaults may be changed by editing the source code and changing 
  40. the values assigned to integers msg and set.  The local clock will
  41. not be adjusted if the measured time difference is 0.
  42.  
  43. Message Format
  44.  
  45.     The message received from NIST is shown below:
  46.  
  47.                         D  L
  48.  MJD  YY MM DD HH MM SS ST S H  Adv.
  49. 49010 93-01-23 22:01:22 00 0 0  50.0 UTC(NIST) * 
  50.  
  51.  
  52. The heading is not part of the message and is shown only
  53. to identify the parameters.  The first number is the date 
  54. expressed as a Modified Julian Day number (MJD), and the next 
  55. 6 values give the Universal Coordinated date and time (formerly 
  56. called Greenwich Mean Time) as year, month, day, hour, minute and 
  57. second.
  58.  
  59.     The eighth number is the daylight saving time flag, DST.
  60. It is based on the continental US system, which has transitions on
  61. the first Sunday in April and the last Sunday in October.
  62.  
  63. DST =  0 means standard time is currently in effect.
  64. DST = 50 means daylight saving time is currently in effect.
  65. DST = 51 means the transition from standard time to daylight time is
  66.          at 2am local time today.
  67. DST =  1 means the transition from daylight time to standard time is
  68.          at 2am local time today.
  69.  
  70. DST > 51 gives advance notice of the number of days to the transition 
  71.          to daylight time.  The DST parameter is decremented at 0000 
  72.          every day during this advance notice period, and the transition
  73.      will occur when the parameter reaches 51 as discussed above.
  74.  
  75. 1 < DST < 50  gives advance notice of the number of days to the 
  76.               transition to standard time.  The DST parameter is 
  77.               decremented at 0000 every day during this advance 
  78.               notice period, and the transition will occur when the
  79.               parameter reaches 1 as discussed above.
  80.  
  81.     The DST parameter is usually not needed for UNIX systems which 
  82. keep time internally using Universal Time. 
  83.  
  84.     The next number is the leap second flag, LS.
  85.  
  86. LS = 0 means no leap second is scheduled.
  87.  
  88. LS = 1 means that a leap second is to be added as 23:59:60 on the
  89.        last day of the current month.  The last minute will therefore
  90.        be 61 seconds long. Leap seconds are usually added at the end
  91.        of either June or December.
  92.  
  93. LS = 2 means that second 23:59:59 is to be dropped on the last day of 
  94.        the current month.  The second following 23:59:58 will be 00:00:00
  95.        of the next day.  This minute will therefore be 59 seconds 
  96.        long.  This situation is unlikely to be necessary in the
  97.        foreseeable future.
  98.  
  99.     Note that leap seconds are inserted or deleted at the specified
  100.         Universal Times, while daylight savings transitions are always 
  101.         with respect to local time.
  102.         
  103. The health parameter, H, gives the health of the server:
  104.  
  105.   H = 0 means that the server is healthy.
  106.  
  107.   H = 1 means that the server is operating properly but that its
  108.         time may be in error by up to 5 seconds. This state should
  109.         change to fully healthy within 10 minutes.
  110.  
  111.   H = 2 means that the server is operating properly but that its
  112.         time is known to be wrong by more than 5 seconds.  
  113.  
  114.   H = 3 means that the hardware or software have failed and that the
  115.         time error is unknown.
  116.  
  117.     The advance parameter, ADV, gives the time advance of the
  118.         transmissions, in milliseconds.  Each time packet is sent 
  119.         out early by this amount to compensate (approximately) for
  120.         the network delay.
  121.  
  122.     The remaining characters on the line identify the time 
  123.         source and are included for compatibility with the ACTS 
  124.         time system.
  125.  
  126. Restrictions
  127.  
  128.     The local time is expected to be given as a number of 
  129.     seconds since 1 January 1970.
  130.  
  131. Bugs
  132.  
  133.     This version does not estimate the transmission delay 
  134.     in the network.  This is unlikely to be a limitation
  135.     over short distances since the time difference is  
  136.     rounded to the nearest second anyway.
  137.  
  138.         The time is instantaneously reset using DosSetDateTime.  If 
  139.         the local clock was ahead of the standard, then time will be
  140.         momentarily non-monotonic.  This has the potential to screw
  141.         up file timestamps used in makefiles.  I don't think it is
  142.         worth the effort to create the equivalent of adjtime (2) to
  143.         avoid this problem.
  144.  
  145. Files
  146.     nistime.exe        executable code with default connections
  147.     nistime.c        source code for main program.
  148.     makefile        compile and link commands.
  149.