2

I ran w32tm /stripchart /computer:time.windows.com just for fun and found out that my clock is 1.3 seconds behind this timeserver. Not that I think Microsoft is wrong, but I tried it with various other timeservers in my city just to eliminate potential network delays. Same result.

The obvious way to fix this would be to force a resync, so I ran w32tm /resync, but the time difference persisted.

When I executed w32tm /query /status to find out what was causing this problem, I was shocked to find out that the default time-data source for my computer was Local CMOS Clock and has apparently never been synced to anything!

I thought I had figured out what was going on and quickly added a few timeservers to my peers using the following command: w32tm /config /manualpeerlist:ntp1.scc.kit.edu /syncfromflags:manual /reliable:yes /update.

But even after another resync, the time difference stayed at 1.3 seconds? What is going wrong?

3 Answers3

6

Turns out w32time simply sucks. Microsoft admitted that

w32time cannot reliably maintain sync time to the range of 1 to 2 seconds.

Great software guys...

I installed a different implementation of the NTP protocol from Meinberg, a company that actually knows what it is doing: NTP Download

And boom: My time difference instantly fell to only a few ms.

23:43:23, d:+00.0135611s o:+00.6267124s
23:43:25, d:+00.0169653s o:+00.6379619s 
23:43:28, d:+00.0145823s o:+00.0086838s  <-- Exact moment the new NTP implementation was installed.
23:43:30, d:+00.0157926s o:-00.0037974s  
1

w32tm service allows to sync the time only within 1 second difference between the PC's and time server's time. Alternatively, you could force it to always synch with the time server at each check regardless of time difference. The value to check is the registry entry "MaxAllowedPhaseOffset" in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config

To force it to always synch, set this value to 0.

But first check that this value is within your desired value. Some systems need to allow for more time difference. Also, note in the w32tm documentation that after a time sync is found to be required (i.e. the difference is greater than the MaxAllowedPhaseOffset), w32tm will change the time either instantaneously or gradually.

Esteban
  • 111
  • 3
0

https://github.com/MicrosoftDocs/windowsserverdocs/issues/2065#issuecomment-544785547

That is what you need to do to have precise time in w32tm.

So, you need HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\NtpServer time.google.com,0x5 time.cloudflare.com,0x1 at least 2 more (in your country and in your local IX or University) https://gist.github.com/mutin-sa/eea1c396b1e610a2da1e5550d94b0453

Now do this from all tabs https://docs.microsoft.com/en-us/windows-server/networking/windows-time-service/configuring-systems-for-high-accuracy?tabs=MaxPollInterval#registry-settings