
                netdate v. 1.04 for Windows 3.1

        Copyright (c) 1995, Gregorian Programmers Guild

                       ***************

Description
-----------

   This is netdate v. 1.04.  I wrote netdate to synchronise my 
desktop PC's clock with my Unix server.  The program requires 
that you give it a host which is providing the time service on 
Port 37 (most, if not all unix boxes).  Getting time from a
unix box you know is using NTP will give you the most accurate
time on your desktop PC.  This program seems to be accurate to
within about +/- 1 sec.

   You must also specify your local timezone.  Basically there 
are two methods for specifying the Time Zone.  You can either 
setup a TZ environment variable in DOS (the hard way) or specify 
a city from the time zone drop down list box.  I've also provided 
a method to adjust the time ahead one half hour for those of you 
living in Newfoundland, Bombay, Calcutta, Delhi, Rangoon, ...

   See below for a description of other options.

   Refer to the file rfc868.txt for a description of the time
service on port 37.

Installation
------------

  - Unzip the archive in a temporary directory.
  - Copy the files netdate.exe and netdate.hlp somewhere convenient 
    (eg. c:\winsock).
  - Check to see whether the file ctl3dv2.dll exists
    in your Windows System directory, if not, do the
    following (assuming your system directory is as
    below),

       1) copy ctl3dv2.zip c:\windows\system
       2) cd \windows\system
       3) unzip ctl3dv2.zip
       4) del ctl3dv2.zip

    MAKE sure the file ctl3dv2.dll is NOT in the same
    directory as the executable (ie., netdate.exe)!

  - add a program manager item
  - run the program

Setting up netdate
------------------

This is pretty trivial.  Specify a host from which you
would like to get time.  If you don't know of any try
tick.usno.navy.mil or tock.usno.navy.mil.  You'll also
have to specify your local timezone.  As mentionned
above there are two ways to do this.

1) Select Time zone from the Drop down List box.  These
   are arranged according to city and I've tried to include
   as many as possible.  There are also 25 timezones at
   the end of the list listed as GMT[+-]nn.  If you are
   west of GMT (Greenwich Mean Time) you'd might select
   GMT+05 (this would be Eastern Standard Time).
   
2) TZ Environment variable

   At the DOS prompt (before starting windows) do

   set TZ=EST5EDT

ideally you'll want to put that line in your autoexec.bat
file.  Of course if you live in Los Angeles you'll use
PST8PDT instead, but you all knew that.  If you live
elsewhere in the world you'll have to find out what the
TZ code is for your area.

Other Options
-------------

* Use daylight savings
 If you live in an area where daylight savings time does
 not apply click this button off.  This effectively subtracts 
 3600 seconds from the time returned by the host.

* Use TZ Env Var
 If this button is greyed you do not have a TZ environment 
 variable set in DOS.  Select a time zone from the Local TZ 
 drop down list.  Otherwise, click it on to use the TZ
 environment variable, or off to select a TZ from the list.

* Add 30 minutes
 If you live in Newfoundland click on Add 30 minutes to
 adjust the time accordingly.

* Report Only
 If you just want to see the time from the host without
 actually resetting your system clock click on this
 button.

* Auto Close
 If you click on Auto Close the program will automatically
 close 5 seconds after time is recieved from a remote host.
 This gives one enough time to turn this option off.

* About
 Click on the About button to get all the gory details,
 including how to snarf a copy of my desktop windows
 program DWM, which is meant to replace that monstrosity
 Program Manager.

* Sound
 Set sounds in the control panel Sound applet.  You must
run netdate at least one time to have the appropriate
entry placed in the [sounds] section of win.ini.  There
are now 3 sound events that may be set,
   - connect
   - reset
   - max adjust

Advanced Options
----------------
* Max adjust
 Specify 0 to have no maximum time adjustment.  Otherwise,
 enter an integer between 1 and 65353 representing the
 largest time adjustment.  If the time returned differs
 from the local time by more than this value a message
 box will prompt asking whether you want to override the
 maximum adjustment.

 Specify one of prompt, ignore or accept to deal with 
 maximum time adjustments.
  prompt - the user is prompted to deal with the event
  ignore - the time recieved is automatically ignored
  accept - the time recieved is automatically accepted

* Logging
 Specify use log to enable logging and Verbose for extra
 information.  You must also specify a logfile.

 Normal Logging Record (tab delimited fields)
  host date TZ Net_Time Cur_Time (nTime-cTime) Total_Net_Lag Action

 Verbose Logging Record (tab delimited fields)
  host date TZ Net_Time Cur_Time Net_Time_Secs Cur_Time_Secs (nTime-CTime)
    Total_Net_Lag Connect_Net_Lag Action

 Action can be one of,
  report - time reported but not changed
  reset  - time reset
  ignore - ignore returned time (max Adjustment event)
  accept - accept returned time (max Adjustment event)
  partial- partial reset (max Adjustment event)

* Calibration Attempts
 Each time netdate is run the time is retrieved this number of
 times in an attempt to calibrate the net lag more accurately.
 Note that this does not apply when the time is retrieved with
 the Get Time button.

Caveats
-------

 You must be running Winsock.

 The file gpg.ini is created in your windows directory
the first time you run the program.

 Net lag is calculated to be half the difference between the time
at connect and when the time data is recieved.  This is a crude
approximation of the time for the return trip but should suffice
for most users.  Getting the time several times and averaging
successive net lags may be a better overall approach and may be
implemented if deemed necessary.

Anti-Caveats
------------

   Netdate is free!  Although I retain copyright and thus the
program is not released into the public-domain, yada-yada-yada.

Author
------
   Steeve McCauley
   steeve@eps.mcgill.ca

    ftp://ftp.eps.mcgill.ca/pub/windows/ndate100.zip
   http://www.eps.mcgill.ca/~steeve/

