首页 > 代码库 > 时间同步

时间同步

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Parameters]
"NtpServer"="timeurl.tencent.com,0x9"


[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpClient]
"SpecialPollInterval"=dword:00000384
"SpecialPollTimeRemaining"=hex(7):74,00,69,00,6d,00,65,00,75,00,72,00,6c,00,2e,\
00,74,00,65,00,6e,00,63,00,65,00,6e,00,74,00,2e,00,63,00,6f,00,6d,00,2c,00,\
37,00,63,00,39,00,39,00,34,00,30,00,34,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers]
@="0"
"1"="time.windows.com"
"2"="time.nist.gov"
"3"="time-nw.nist.gov"
"4"="time-a.nist.gov"
"5"="time-b.nist.gov"
"0"="timeurl.tencent.com"
 
 
 
"NtpServer"="timeurl.tencent.com,0x9"  此处设定时间同步服务器
"SpecialPollInterval"=dword:00000384   此处设定同步频率  秒 16进制
SpecialPollTimeRemaining 可以不设置 重启时间服务 自动同步NtpServer的值
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers] 设定时间同步界面上显示的列表和默认值
 
 

将HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters内的NtpServer设定为timeurl.tencent.com,0x9
将HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient内的SpecialPollTimeRemaining设定为timeurl.tencent.com,7c99404

若只设定NtpServer项,在重启两次w32time后SpecialPollTimeRemaining项也会自动修改。
若只设定SpecialPollTimeRemaining项,在重启w32time后,NtpServer项设置自动原还。
所以只须设定NtpServer项,重启两次w32time即可。


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient内的SpecialPollInterval设定为900    十进制

时间同步