[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Tame (and time)
- Subject: Re: Tame (and time)
- From: "Robert Holmgren" holmgren@xxxxxxxx
- Date: Sat, 21 Dec 2002 21:30:35 -0800
** Reply to message from fenda@xxxxxxxx on Fri, 20 Dec 2002 13:09:51 +0100
Incidentally, Manuel, if you don't use XyShell (which has a built-in SNTP
client called SETTIME), you can fall back on Win2K's own (little known)
built-in NTP client, to set your system time with considerable precision by
synchronizing with a time server. To tell the truth, SETTIME has an accuracy
of about 1 second -- but it was fun to write a S[imple]NTP client -- whereas
the W32TIME service or the on-the-fly W32TM executable are probably accurate to
milliseconds. Anyway, my server runs the following BAT (which I've just
commented liberally) every day. Try it, you'll like it. And BTW, I forgot to
mention that the TZ environment variable doesn't rule in W2K (unlike any other
OpSys), unless of course a program specifically reads it, in which case it
matters. But mostly, in W2K what counts is the stupid clock object in Control
Panel, "Time/Zone" or whatever they call it -- make sure you've got that set
correctly for your region.
--------------------SNTP.BAT--------------
:@echo off
:Get/Set System Time with [Simple]NTP client RJH 9/21/01
:Make sure UDP port 123 is open
:Note that only TWO lines in this BATfile actually execute --
: 1) set your NTP server (nearby!), and 2) synchronize your time with it
:Good for northern Spain (closest RELIABLE NTP server is Lyon)
net time /setsntp:ntp.univ-lyon1.fr
:Same thing but faster (because no DNS translation)
:net time /setsntp:134.214.100.6
:Good for USA (Nat.Inst.Standards&Technology "NIST", Boulder Colorado)
:net time /setsntp:time-a.timefreq.bldrdoc.gov
:aka
:net time /setsntp:132.163.4.101
:or US Naval Observatory
:net time /setsntp:tick.usno.navy.mil
:or its friend
:net time /setsntp:tock.usno.navy.mil
:Make sure the server you pick WORKS! A lot of them really suck,
: e.g. all the Spanish ones I've tried
w32tm -once
:or do it s-l-o-w-l-y (pipe through MORE filter)
:w32tm -once |MORE
:If joy, squelch the output
:w32tm -once >NUL
:Pretty wounderful, ain't it? Time just goes wound and wound
-------------------------------------------------------
-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------