Tech Journal Back to Tech Journal

Syncronizing time via NTP

NTP, or Network Time Protocol can be used to syncronize your gateway machine to an internet time server (some atomic clock), and then you can sync all of your network to that gateway. This is better than having everybody sync to a remote server, since the closer the server is to the client, the more accurate the reading will be, which is crucial for time-based applications, such as Revision Control.

On Windows, use Tardis 2000 (both as server and client). For Linux, use ntpdate, like so:


Where you should replace with the time server closest to you (or whatever one you choose, as long as it supports NTP). Servers that I use:

Another way to do this, (this is not done using the same protocol, though) is to use rdate, like so:

rdate -s

Where -s means set. You can also use -p to just poll the time server (in this case, without setting the system's time.

BTW, if you want (on Linux) to sync the hardware clock (which keeps running when the computer if off) with the software clock (which you presumable set in sync with an accurate atomic clock):

/sbin/hwclock --systohc

Please note, that if you want the hardware clock to run on GMT/UTC, you need to run the timeconfig tool, and set the "Hardware Clock Runs on GMT". (You can also do this by editing /etc/sysconfig/clock and making sure there's a line that reads: UTC=true) And then use the --utc paramater when dealing with the HW clock, like so:

/sbin/hwclock --utc --systohc

Which will set the HW clock to GMT time, using the localized time from the OS clock, but adjusting for the timezone difference from GMT.

Last updated on 2000-09-24 14:00:00 -0700, by Shalom Craimer

Back to Tech Journal