Configure Windows time with high (sub seconds) pre

2020-03-06 08:00发布

http://time.is/ is constantly reporting my system clock as several seconds off (usually ahead) even if I freshly force synchronization of windows clock with some of the internet time servers (e.g. time.windows.com or time.nist.gov). This is complicating development of components integrating with remote servers that disconnects me if my timestamps are over second off. Our production HW have specialized HW clock provider with microsecond precision. I do not need anything like that in dev environment, but precision not worse than second is needed. Is there any public time server or reliable time synchronization utility that can achieve this?

EDIT1: I found and answer to different question that actually also answers my question. https://serverfault.com/a/489016. Among others it mentions:

Conclusion: for better precision than in order of 1 or two seconds you need to use third party time synchronization service.

5条回答
▲ chillily
2楼-- · 2020-03-06 08:16

If your machine is part of an Active Directory env, then its clock is automatically sync'd to the clock of your AD controller (which is likely sync'd to some other time source). So you should look to fix the time problem on the AD controller.

If you scroll 2/3 of the way down on this page: http://www.cites.illinois.edu/network/activedirectory.html it will tell you if your machine is in an AD domain.

If your machine is not in an AD, you can run

w32tm /stripchart /computer:time.windows.com

to tell how far out of sync your machine is with a time source (substitute time.windows.com with your time source).

If you want to resync to the time source immediately, run:

w32tm /config /syncfromflags:manual /manualpeerlist:time.windows.com    
w32tm /config /update 
w32tm /resync

and ofcourse you can re-run "w32tm /stripchart /computer:time.windows.com" to see if it really worked.

查看更多
\"骚年 ilove
3楼-- · 2020-03-06 08:22

Just enter the command time if you want the system time.
Like from the command line.

I am just having trouble believing synch immediately followed by time is wrong.

查看更多
成全新的幸福
4楼-- · 2020-03-06 08:26

Windows Server 2016 has made improvements to time accuracy. 1ms accuracy can be achieved in your domain under the right conditions. See https://aka.ms/WS2016Time for more information.

查看更多
何必那么认真
5楼-- · 2020-03-06 08:27

Standard Windows time service doesn't guarantee precision better than in order of seconds (see http://support.microsoft.com/kb/939322). So third party time synchronization service needs to be used for sub-second precision. List of available providers is maintained by NIST here: http://www.nist.gov/pml/div688/grp40/softwarelist.cfm.

I personally finally chose http://www.timesynctool.com/ (as it is free, reliable and mostly open source - so I can be sure what exactly it's doing)

查看更多
唯我独甜
6楼-- · 2020-03-06 08:39
    net stop w32time
    w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
    net start w32time
    w32tm /config /update
    w32tm /resync /rediscover

.BAT Sample File :https://gist.github.com/thedom85/dbeb58627adfb3d5c3af

I also recommend this program :http://www.timesynctool.com/

查看更多
登录 后发表回答