Time synchronization

Tue, 2007-07-17 20:20 by admin · Forum/category:

Table of contents

for this article

Use one of your local computers as time server

To set a computer's clock from another computer in the Local Area Network, use the command:

net time \\computername /set /yes

Replace computername with the name of the computer from which the time is to be derived. Make sure each computer runs this command sufficiently often. Use the scheduler or the AT command for this purpose or at least make sure each workstation runs this command once after booting.

Of course at least the computer from which all others get their time should obtain its proper time from an external time server as described below.

For more information enter:

net help time

In a typical home network it may be better to let each computer regularly get its time directly from an external time source, particularly when there is no particular computer that is always guaranteed to run.

Preconditions for automatic time synchronization

If the time synchronization does not work, check the following.

  1. The Windows Time service has to be set to Automatic and Started.
  2. The firewall must not block the Time Service connection. This is unlikely to happen, as it is an outgoing connection, normally not hampered by firewalls, but if you use a third party firewall that limits outgoing connection ports as well, make sure it allows TCP and UDP connections on the NTP (Network Time Protocol, or SNTP = Simple Network Time Protocol) port 123.

Which time server should I use?

Various lists of time servers are available on the Internet. You can test these servers by using the tracert command and selecting the one with the lowest number of hops.

If you don't want to fiddle with that and don't want to worry about time server reliability, you can use one of the following pool server addresses:

There are also country pools. Click on the links in the table above to find the pool for your country.

It is not advisable to use country pools that consist only of very few servers. If your country has less than 3 servers, it is probably better to use the pool of the entire continent.

Test the pool initially, to find out its quality. For example, the German pool de.pool.ntp.org has had at least one server for years that is 17 seconds off (probably GPS time mistaken for UTC, because that is also off by 17 seconds). Take into account that some of the people who contribute to this scheme are hobbyists and at least one looks like an idiot or a saboteur.

To give another example of how badly the system is run, I tried to enter this fact as a bug into their bug tracking system, only to find that I have to register, that I cannot change my password, that I cannot remove my data from the system, and that they publish my email address on their web site without my consent, after I enter a bug report.

All this casts some doubt over the whole scheme. I'm supporting it nonetheless, because I believe that the basic idea is sound and hope that things will get better over time.

Set your clock over the Internet more often

The following registry key controls how often the Windows time client accesses an Internet time server and sets your computer's clock.

HKEY_LOCAL_MACHINE
 \System
  \CurrentControlSet
   \Services
    \W32Time
     \TimeProviders
      \NTpClient
  Value name: SpecialPollInterval
  Value type: DWORD
  Value: 604800

This value is the time in seconds. The default is 7 days.

It is not recommendable to set this time to less than a few hours because the time server access attempts could have some negative influence, particularly if the computer is not permanently connected to the Internet. It could, for example, cause an automatic dial-up.

The change of this value becomes effective only after you stop and restart the W32Time service. You can also reboot the computer to do that.

It seems that the time client retries after 15 minutes after it failed to reach the Internet time server. A way to change this time is not known.

Time zone settings

If you haven't looked at your time zone settings, check them by right-clicking the computer's clock in the lower right corner and selecting to change the date and time. Make sure your time zone is correctly chosen and the checkbox to change the daylight saving time (DST) automatically is checked.

Time updated for daylight savings more than once

This error occurs when several agents like operating systems, the computer's BIOS, or installed software, automatically update the time when daylight savings time begins or ends.

Make sure that only one agent switches DST (Daylight Saving Time) on and off. For example, if you have more than one operating system installation on the same computer, only the most-used installation should be set to automatically change DST. There is also a Microsoft Knowledge Base article explaining this:

Time Updated for Daylight Savings More Than Once
http://support.microsoft.com/kb/155981/