TimeKeeper

Copyright © 1996 Levin-Delson Software All Rights Reserved

TimeKeeper uses a modem to connect to the Automated Computer Time Service (ACTS) of the National Institute of Standards and Technology (N.I.S.T.) in Boulder, Colorado U.S.A. and sets the BeBox's system clock to the correct time. TimeKeeper will take the user's timezone into account, and will adjust for daylight savings time (DST) if the user chooses to observe the convention.

The first time it is run, TimeKeeper simply sets the system clock. On subsequent invocations, TimeKeeper will report on the accuracy of the BeBox's clock.

To use TimeKeeper, first determine if you need to change any settings from their defaults (see below) and if so, edit the settings files and put them in their proper place.

Double-click on TimeKeeper's icon, or type "TimeKeeper" from the shell. TimeKeeper opens a window to keep you informed of the status of the connection. Once the transmission has been received, and the clock set, TimeKeeper will display the accuracy of the system clock during the period of time since the previous adjustment. Click the close button of the window to terminate TimeKeeper.


Settings Files

TimeKeeper makes use of several support files. Two files contain system- and user-configurable settings, and may be edited by you. Neither of them are required if the default settings match your needs. The third file is created by TimeKeeper and is updated each time it is invoked.

  • /boot/system/settings/TimeZone_settings
  • Contains the timezone settings. This information is of general system interest, and should really be provided by BeOS, but as of DR8 it is not. There are indications that it will be supported in the future.
    HOURS_TO_ADD_TO_UTC
    is the offset in hours (signed floating-point) to be added to Universal Coordinated Time (UTC) to obtain the user's local time (standard time, not DST).
    OBSERVE_DST_IF_IN_EFFECT
    indicates whether the user chooses to observe DST (string, "YES" or "NO") if it is in effect.
    An example of the TimeZone_settings file for the Pacific time zone follows.
    HOURS_TO_ADD_TO_UTC -8.0
    OBSERVE_DST_IF_IN_EFFECT YES
    If this file is missing, TimeKeeper defaults to,
    HOURS_TO_ADD_TO_UTC 0.0
    OBSERVE_DST_IF_IN_EFFECT NO
    Which results in the system clock being set to UTC.

  • /boot/system/settings/TimeKeeper_settings
  • Contains settings to select the serial port and control the modem.
    PORT_NAME
    describes which serial interface to use.
    INIT_STRING
    is the string to initialize the modem.
    DIAL_STRING
    is the string that causes the modem to dial a number.
    PHONE_NUMBER
    is the phone number to dial to reach the N.I.S.T. time server.
    The serial port's Baud rate and bit configuration are not changeable. The ACTS transmission is optimized for 1200 Baud, 8N1.

    An example of the TimeKeeper_settings file follows. The values shown happen to be the defaults used if the file is missing.

    INTERFACE "serial1"
    INIT_STRING "ATZ"
    DIAL_STRING "AT&C1DT"
    PHONE_NUMBER "1 303 494-4774"

  • /boot/system/settings/TimeKeeper_data
  • Contains data needed by TimeKeeper to compute the accuracy of the system clock. This file is maintained by TimeKeeper, and will be created if it doesn't exist.


    Notes

    The call to the N.I.S.T. is not free and may be a long-distance call. Be careful if invoking TimeKeeper when the system is unattended (such as from a script) lest a programming error cause unwanted calls.
  • The author assumes no responsibility for any damages, direct or consequential, caused by TimeKeeper.
  • TimeKeeper is provided "as-is".
  • Use at your own risk.
  • Caveat emptor.
  • Nobody's perfect.

    The N.I.S.T.'s ACTS server automatically terminates the modem connection after forty seconds. TimeKeeper typically obtains the time in several seconds after connecting, and terminates the call immediately afterwards.

    TimeKeeper increases its task priority to B_REAL_TIME_PRIORITY while it is receiving the ACTS transmission to insure that the clock is set accurately. Be aware that this may effect other running tasks.

    Though the N.I.S.T. phone number can be changed, the transmission format that TimeKeeper understands is limited to ACTS. It is therefore unlikely that it will be able to obtain the time from any other provider.

    Because delays in telephone connections would render the timestamp inaccurate, TimeKeeper is probably only useful to users in the Unites States, and possibly only to those on the mainland.

    TimeKeeper may not be distributed without the author's explicit permission.


    History

  • 1.0 Internal version.
  • 1.1 First public release.
  • 1.2 Made connection routine more robust.
  • 1.3 Corrected bug that caused DST/ST changeover to be off by one day. Now spawns separate thread for ACTS connection.