Windows 2000

If you want your Windows 2000 computer to automatically correct its clock (so you don't have to) then you'll be glad to know that it comes with built-in software to do so.

First of all, you will need to find an NTP server. Many ISPs provide one, so look at the tech support section of their web site. Often an ISPs Domain Name servers will also run an NTP service. If you can't find one then check the list of public NTP servers at <http://www.eecis.udel.edu/~mills/ntp/servers.html> for one close to your location.

Log in with administrative privileges and go to the command prompt. Run the Net command in this way:

net time /setsntp:ntp.server.com

where ntp.server.com is the address (it can be an IP address) of your NTP server. If you want to specify multiple servers then you can do so, if you separate them by spaces and enclose the entire list with double-quotes (").

To test your server, run w32tm -v -once -test and examine the output. This command attempts to synchronise with the NTP server(s), and the arguments you passed it tell it to print the output to the screen (verbose), to only synch once and to not attempt to actually set the system clock.

If all went well then you should see "48 bytes received" somewhere in the output. If not, try a different server. If you are behind a firewall you will have to make sure that the packets from the NTP server are able to reach you - NTP uses UDP, port 123.

Once you know your server works then go to the Services Manager (run services.msc). Scroll down to the Windows Time service and set it to Automatic. Start the service.

Your computer will now attempt to synch every 45 minutes, until it gets three good synchs, after which it will synch once every eight hours.

Never adjust your clock again! :)

Windows XP

Fire up the Group Policy editor (gpedit.msc) and hop to Local Computer Policy | Administrative Templates | System | Windows Time | Time Providers and set the options there. You will have to enable the NTP Client, set the server name to something appropriate and set the Type to NTP.

After you affect the changes you will see a status report in the System Event Log. To force a manual resync, use w32tm /resync.

carnun writes, in ntp you talk about setting up WinXP for ntp. AFAIK the Win implementation is actually of SNTP and is designed to provide accuracy between .5 and 2 secs. Who am I to argue?

Debian GNU/Linux

As root, run apt-get install ntpdate. Debconf will prompt you for an NTP server; enter one from the list above. Your clock will be synched immediately, as well as once during boot, or more often if you put /etc/init.d/ntpdate restart in a cron job. If you want to serve time data to your network, check out the ntp package.