首先介绍一个命令行,以下是Windows官网文档
Microsoft Docs:https://docs.microsoft.com/zh-cn/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/ff799054(v=ws.11)
W32tm
You can use the W32tm.exe tool to configure Windows Time service (W32time) settings. You can also use W32tm.exe to diagnose problems with the time service. W32tm.exe is the preferred command-line tool for configuring, monitoring, or troubleshooting the Windows Time service.
在cmd中输入 w32tm 可以查看命令帮助。
命令范例
w32tm /config /manualpeerlist:ntp2.aliyun.com /syncfromflags:manual /update
(我这里是用阿里云的NTP服务器)
设置NTP服务器地址的话可以从NTP注册表的值进行修改(不一定非要在控制面板中设置,其实俩效果是一样的)
路径:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Ntp