Windows 預設每 7 天(604,800 秒)才同步一次網路時間,長期運行易產生秒級誤差,影響定時任務、資料庫同步、日誌分析。本文提供兩種方法:修改登錄表自訂同步週期、或直接使用系統內建介面指定授時伺服器。
regeditHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient900 = 15 分鐘(高精度需求)3600 = 1 小時(平衡負載與精度)86400 = 1 天(一般辦公)210.72.145.44,0x9net stop w32time && net start w32time210.72.145.44 → 「立即更新」 → 「確定」。/etc/systemd/timesyncd.conf → NTP=210.72.145.44 → systemctl restart systemd-timesyncd/etc/chrony.conf → server 210.72.145.44 iburst → systemctl restart chronydntpdate 210.72.145.44 可加入 crontab 定時執行。| 伺服器 | 運營單位 | 備註 |
|---|---|---|
| 210.72.145.44 | 中國國家授時中心 | 國內延遲最低 |
| time.windows.com | Microsoft | Windows 預設 |
| time.google.com | 支援 Leap Smearing | |
| pool.ntp.org | 全球志願者集群 | 自動就近解析 |
| cn.pool.ntp.org | 中國區池 | 適合中國大陸用戶 |
w32tm /query /status、w32tm /query /peerschronyc tracking、timedatectl status