SNTP (Simple Network Time Protocol) is a simple version of the NTP
protocol used for synchronizing computer clocks. It allows
your machine to fetch a reasonably accurate timestamp from an NTP
server and optionally set your system time to that time. This is great
for older systems that do not have a clock/calendar or for keeping
systems that do reasonably accurate.
(Note: DOSBox is great
for getting screen shots, but it doesn't actually let you set the time!
On a virtual machine running DOS or a real PC the time would get set,
but under DOSBox it just happily reports the time is set and does
nothing.)
The executable (sntp.exe) is only 40KB in size and runs well on any
machine you get put it on. I use it now to check and set the time on a
PC XT which doesn't have a clock/calendar - it gets done right in the
autoexec.bat file after DHCP runs to get an address. You can expect
SNTP to be accurate to within about 1 second. There is more that I can
do to make it accurate but on a machine with 55ms timer resolution
there isn't much point.
One thing that needs to be done first is setting the TZ environment
variable so that the program knows what timezone you are in. I am using
the Open Watcom compiler and that follows the POSIX standard where
timezones west of GMT
use positive offsets while timezones east of GMT use negative ones.
(This is opposite of what Windows does.) Here are some
examples:
set
TZ=EST5EDT
(US Eastern
Standard, 5 hour offset, DST is observed)
set
TZ=CST6CDT
(US Central, 6 hour
offset, DST is observed)
set
TZ=UTC-1
(One hour east of
GMT, somewhere in Europe maybe?)
set
TZ=CET-2CDT
(Two hours east of
GMT, DST is observed)
The full rules for setting it, including how to write a rule for when
DST is observed can be found in the docs.
Download!
SNTP is included with the other mTCP based applications. They can be
downloaded from the main mTCP page
here.
Created August 21st, 2010, Last updated July 29th, 2011 (C)opyright Michael B. Brutman, mbbrutman@gmail.com