Windows 时间服务工具和设置

Windows 时间服务 (W32Time) 为 Active Directory 域服务 (AD DS) 管理的所有计算机同步日期和时间。 本文介绍用于管理 W32Time 的各种工具和设置。

默认情况下,加入域的计算机会通过域层次结构的时间源同步时间。 有时,因为计算机以前未加入域,所以需要手动配置计算机从特定的时间源同步。 在这种情况下,可以重新配置计算机,以从域层次结构自动溯源其时间。

大多数已加入域的计算机的时间客户端类型为 NT5DS(Net Time 5 目录服务),这意味着它们从域层次结构进行时间同步。 一个例外是充当森林根域的主域控制器(PDC)模拟器操作主控的域控制器。 而 PDC 仿真器操作主机配置为使用外部时间源来同步时间。

你可以在你的域中实现低至一毫秒的时间精度。 有关详细信息,请参阅支持高精度时间边界Windows Server 2016 准确时间

Network port

W32Time 遵循网络时间协议 (NTP) 规范,该规范要求使用用户数据报协议 (UDP) 端口 123 进行所有时间同步。 计算机同步其时钟或向另一台计算机提供时间时,该同步在 UDP 端口 123 上进行。 W32Time 将此端口保留为目标端口。

Note

  • NTP 服务器通常侦听 UDP 端口 123 中的请求并从同一端口做出响应,这对于内置 W32Time NTP 服务器也是如此。
  • 可以独立启用或禁用内置 W32Time NTP 客户端和 NTP 服务器。 两者共享 UDP 端口 123 作为其功能。
  • 内置 W32Time NTP 客户端只能使用 UDP 123 作为源端口。
  • 如果计算机有多个网络适配器(它是多宿主),则不能基于网络适配器启用 W32Time。

W32Time 的命令行参数

可以使用 w32tm 此命令配置 W32Time 设置和诊断计算机时间问题。 该 w32tm 命令是用于配置、监视和排查 W32Time 问题的首选命令行工具。 本地管理员组中的成员身份是在本地运行此工具所必需的,并且需要域管理员组中的成员身份才能远程运行此工具。

若要使用 w32tm,请执行以下步骤:

  1. Select Start, and then enter cmd. Right-click Command Prompt, and then select Run as administrator.
  2. At the command prompt, enter w32tm followed by the applicable parameters.
Parameter Description
/? 显示w32tm命令行帮助。
/config [/computer:<target>] [/update] [/manualpeerlist:<peers>] [/syncfromflags:<source>] [/LocalClockDispersion:<seconds>] [/reliable:(YES|NO)] [/largephaseoffset:<milliseconds>] /computer:<target>:调整 <target> 的配置。 如果未指定,则默认目标是本地计算机。

/update: Notifies W32Time that the configuration is changing, causing the changes to take effect.

/manualpeerlist:<peers>:将手动对等列表设置为 <peers>,这是以空格分隔的域名系统(DNS)或 IP 地址列表。 当您指定多个对等方时,必须用引号将此选项括起来。

/syncfromflags:<source>:设置 NTP 客户端应从中同步的源。 The <source> value should be a comma-separated list of the following keywords (not case sensitive):

  • MANUAL: Include peers from the manual peer list.
  • DOMHIER: Synchronize from a domain controller (DC) in the domain hierarchy.

/LocalClockDispersion:<seconds>:配置 W32Time 在无法从配置源获取时间时使用的内部时钟的准确性。

/reliable:(YES|NO): Sets whether this computer is a reliable time source. 此设置仅对域控制器有用。

  • YES: This computer is a reliable time service.
  • NO: This computer isn't a reliable time service.

/largephaseoffset:<milliseconds>:设置 W32Time 视为峰值的本地时间和网络时间之间的时间差。

/debug {/disable | {/enable /file:<name> /size:/<bytes> /entries:<value> [/truncate]}} 启用或禁用本地计算机 W32Time 专用日志。

/disable: Disables the private log.

/enable: Enables the private log.

  • file:<name> :指定绝对文件名称。
  • size:<bytes> :指定循环日志记录的最大大小。
  • entries:<value>:包含由数字指定的标志列表,并用逗号分隔,指定应记录的信息类型。 Valid values are 0 to 300. A range of numbers is valid, as are single numbers, such as 0-100,103,106. A value of 0-300 is for logging all information.

/truncate: Truncates the file if it exists.

/dumpreg [/subkey:<key>] [/computer:<target>] 显示与给定注册表项关联的值。

The default key is HKLM\System\CurrentControlSet\Services\W32Time (the root key for W32Time).

/subkey:<key>:显示与默认项的子项 <key> 相关联的值。

/computer:<target>:查询计算机 <target> 的注册表设置。

/monitor [/domain:<domain name>] [/computers:<name>[,<name>[,<name>...]]] [/threads:<num>] Monitors W32Time.

/domain: Specifies which domain to monitor. If no domain name is given, and the /domain and /computers options aren't specified, the default domain is used. 此选项可以多次使用。

/computers: Monitors the given list of computers. 计算机名称以逗号分隔,不含空格。 如果名称以星号为前缀(*),则它被视为 PDC。 此选项可以多次使用。

/threads: Specifies the number of computers to analyze simultaneously. The default value is 3. The allowed range is 1-50.

/ntpte<NTP time epoch> Converts an NTP time (measured in 2-32-second intervals starting from 0h 1-Jan 1900) into a readable format.
/ntte<NT time epoch> Converts a Windows NT system time (measured in 10-7-second intervals starting from 0h 1-Jan 1601) into a readable format.
/query [/computer:<target>] {/source | /configuration | /peers | /status} [/verbose] 显示计算机的 W32Time 信息。

/computer:<target>:查询 <target> 的信息。 如果未指定,则默认值为本地计算机。

/source: Displays the time source.

/configuration: Displays the runtime configuration and the source of the settings. 在详细模式下,此参数还显示未定义或未使用的设置。

/peers: Displays a list of peers and their status.

/status: Displays the W32Time status.

/verbose: Turns on verbose mode to display more information.

/register 将 W32Time 注册为服务,并将其默认配置信息添加到注册表。
/resync [/computer:<computer>] [/nowait] [/rediscover] [/soft] 告知计算机应该尽快重新同步其时钟,并丢弃所有累积的错误统计信息。 NTP 客户端要求 UDP 123 作为源端口。

/computer:<computer> :指定应重新同步的计算机。 如果未指定计算机,则本地计算机将重新同步。

/nowait: Doesn't wait for resynchronization to occur. 而是立即返回。 如果此选项不存在,该命令将等待重新同步完成,然后再返回。

/rediscover: Redetects the network configuration, rediscovers network sources, and then resynchronizes.

/soft: Resynchronizes by using existing error statistics. 此选项用于兼容性目的。

/stripchart /computer:<target> [/period:<refresh>] [/dataonly] [/samples:<count>] [/rdtsc] 显示此计算机和另一台计算机之间偏移量的带状图。 NTP 客户端使用临时 UDP 源端口与服务器通信,以防止与内置 NTP 客户端发生冲突。

/computer:<target>:指定与之进行偏移量测量的计算机。

/period:<:>指定样本之间的时间(以秒为单位)。 The default value is 2.

/dataonly: Displays the data only, without graphics.

/samples:<count>:收集<count>个样本,然后停止。 If not specified, samples are collected until Ctrl+C is selected.

/rdtsc: For each sample, prints comma-separated values along with the headers RdtscStart, RdtscEnd, FileTime, RoundtripDelay, and NtpOffset instead of the text graphic.

  • RdtscStart: The Read Time Stamp Counter (RDTSC) value collected just before the NTP request is generated.
  • RdtscEnd: The RDTSC value collected just after the NTP response is received and processed.
  • FileTime: The local FILETIME value used in the NTP request.
  • RoundtripDelay: The time elapsed in seconds between generating the NTP request and processing the received NTP response, computed as per NTP roundtrip computations.
  • NTPOffset: The time offset in seconds between the local computer and the NTP server, computed as per NTP offset computations.
/tz 显示当前时区设置。
/unregister 注销 W32Time,并从注册表中删除其所有配置信息。

将客户端设置为使用两个时间服务器

若要将客户端计算机设置为指向两个不同的时间服务器,一个名为 ntpserver.contoso.com,另一个名为 clock.adatum.com,请运行以下命令:

w32tm /config /manualpeerlist:"ntpserver.contoso.com clock.adatum.com" /syncfromflags:manual /update

将客户端设置为自动从域源同步时间

假设你有一台客户端计算机,该客户端计算机当前使用手动指定的计算机同步时间。 若要将客户端计算机配置为从 AD 域层次结构自动同步时间,请运行以下命令:

w32tm /config /syncfromflags:domhier /update

net stop w32time

net start w32time

检查客户端时间配置

若要从主机名为 contosoW1 的基于 Windows 的客户端计算机检查客户端配置,请运行以下命令:

w32tm /query /computer:contosoW1 /configuration

此命令的输出列出了为客户端设置的 W32Time 配置参数。

自 Windows Server 2016 以来,对 时间同步算法 的改进支持与注释请求(RFC)规范的一致性。 因此,如果要将本地时间客户端设置为指向多个对等方,建议准备三个或更多不同的时间服务器。

If you have only two time servers, you should specify the NtpServerUseAsFallbackOnly flag (0x2) to deprioritize one of them. 例如,如果希望 ntpserver.contoso.com 的优先级高于 clock.adatum.com 的优先级,请运行下面的命令:

w32tm /config /manualpeerlist:"ntpserver.contoso.com,0x8 clock.adatum.com,0x2" /syncfromflags:manual /update

此外,还可以运行以下命令并读取输出中的值 NtpServer

reg query HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters

配置计算机时钟的重置功能

为了使 w32tm 重置计算机时钟,它首先会检查当前时间与计算机时钟时间之间的偏移量 CurrentTimeOffset(也称为 Phase Offset)以确定偏移量是否小于 MaxAllowedPhaseOffset 值。

  • CurrentTimeOffsetMaxAllowedPhaseOffset:使用时钟速率逐步调整计算机时钟。
  • CurrentTimeOffset > MaxAllowedPhaseOffset:立即设置计算机时钟。

使用时钟速率调整计算机时钟后,w32tm 计算一个 PhaseCorrection 值。 此算法因 Windows 的版本而异:

  • Windows Server 2016 及其更高版本:

    PhaseCorrection_raw = (CurrentTimeOffset) ÷ (16 × PhaseCorrectRate × pollIntervalInSeconds

    MaximumCorrection = (CurrentTimeOffset) ÷ (UpdateInterval ÷ 100)

    PhaseCorrection = min(PhaseCorrection_rawMaximumCorrection

  • Windows Server 2012 R2 及较早版本:

    PhaseCorrection = (CurrentTimeOffset) ÷ (PhaseCorrectRate × UpdateInterval

所有版本的 Windows 均使用相同的最终公式来检查 PhaseCorrection

PhaseCorrection SystemClockRate ≤ ÷ 2

Note

以下操作系统从 KB5006744 开始应用累积更新,因此它们采用 Windows Server 2016 及更高版本的更新方式公式:

  • Windows Server 2025
  • Windows Server 2022
  • Windows Server 2019 版本 1809
  • Windows 11
  • Windows 10 版本 1809

在这些公式中,PhaseCorrectRateUpdateIntervalMaxAllowedPhaseOffsetSystemClockRate以时钟刻度为单位测量。 在 Windows 系统上,1 毫秒等于 10,000 时钟刻度。

可以在注册表中配置 MaxAllowedPhaseOffset 值。 但是,注册表参数是以秒为单位(而不是以时钟计时周期为单位)来测量的。

SystemClockRate若要查看和pollIntervalInSeconds值(以秒为单位),请打开命令提示符窗口,然后运行以下命令: w32tm /query /status /verbose 此命令生成类似于以下行的输出:

Leap Indicator: 0(no warning)
Stratum: 1 (primary reference - syncd by radio clock)
Precision: -23 (119.209ns per tick)
Root Delay: 0.0003538s
Root Dispersion: 0.0100002s
ReferenceId: 0x00000000 (unspecified)
Last Successful Sync Time: 5/23/2023 7:51:39 PM
Source: VM IC Time Synchronization Provider
Poll Interval: 6 (64s)
 
Phase Offset: -0.0000013s
ClockRate: 0.0156250s
State Machine: 2 (Sync)
Time Source Flags: 3 (Authenticated Hardware )
Server Role: 0 (None)
Last Sync Error: 0 (The command completed successfully.)
Time since Last Good Sync Time: 15.7344985s

在输出中,轮询间隔以时钟周期和秒为单位列出。 公式使用以秒为单位来测量的值(圆括号中的值)。

输出以秒为单位列出时钟速率。 若要以时钟刻度为单位计算 SystemClockRate 值,请使用以下公式:

value in clock ticks) = (value in seconds) × 1,000 × 10,000

此公式使用以下转换因素:

  • 一秒等于 1,000 毫秒。
  • One millisecond equals 10,000 clock ticks on a Windows system, as described in DateTime.Ticks Property.

For example:

  • 如果 SystemClockRate 为 0.0156250 秒,则公式生成的值为 156,250 时钟刻度。
  • 按扩展,5 分钟变为 5 × 60 × 1000 × 10000 = 3,000,000,000 时钟刻度。

以下示例演示如何为 Windows Server 2012 R2 和早期版本应用阶段更正计算。

示例:系统时钟速率关闭四分钟

如果计算机时钟时间为 11:05,并且实际当前时间为 11:09, w32tm 请使用以下值:

  • PhaseCorrectRate = 1
  • UpdateInterval = 30,000 个时钟计时周期
  • SystemClockRate = 156,000 个时钟计时周期
  • MaxAllowedPhaseOffset = 10 分钟 = 600 秒 = 600 x 1,000 x 10,000 = 6,000,000,000 个时钟计时周期
  • CurrentTimeOffset = 4 分钟 = 4 × 60 × 1,000 × 10,000 = 2,400,000,000 个时钟计时周期

若要重置时钟, w32tm 请检查以下条件:

CurrentTimeOffsetMaxAllowedPhaseOffset

在这种情况下,条件具有以下值,因此计算结果为 true:

2,400,000,000,000 ≤ 6,000,000,000

接下来, w32tm 检查以下条件:

(CurrentTimeOffset) ÷ (PhaseCorrectRate × UpdateInterval) ≤ SystemClockRate ÷ 2?

在这种情况下,条件具有以下值:

2,400,000,000 ÷ (30,000 × 1) ≤ 156,000 ÷ 2,或 80,000 ≤ 78,000

此条件为假。 因此, w32tm 立即将时钟设置回去。

Note

在此示例中,如果要慢慢地调回时钟,还必须调整注册表中的 PhaseCorrectRateUpdateInterval 的值,以确保公式结果为 true。

示例:系统时钟误差了三分钟

如果计算机时钟时间为 11:05,并且实际当前时间为 11:08, w32tm 请使用以下值:

  • PhaseCorrectRate = 1
  • UpdateInterval = 30,000 个时钟计时周期
  • SystemClockRate = 156,000 个时钟计时周期
  • MaxAllowedPhaseOffset = 10 分钟 = 600 秒 = 600 x 1,000 x 10,000 = 6,000,000,000 个时钟计时周期
  • CurrentTimeOffset = 3 分钟 = 3 × 60 × 1,000 × 10,000 = 1,800,000,000 个时钟计时周期

若要重置时钟, w32tm 请检查以下条件:

CurrentTimeOffsetMaxAllowedPhaseOffset

在这种情况下,条件具有以下值,因此计算结果为 true:

1,800,000,000,000 ≤ 6,000,000,000

接下来, w32tm 检查以下条件:

(CurrentTimeOffset) ÷ (PhaseCorrectRate × UpdateInterval) ≤ SystemClockRate ÷ 2?

在这种情况下,条件具有以下值:

(1,800,000,000) ÷ (1 × 30,000) ≤ 156,000 ÷ 2,或 60,000 ≤ 78,000

此条件为真。 将时钟慢慢调回。

使用本地组策略编辑器

W32Time 将多个配置属性存储为注册表项。 可以使用本地组策略编辑器中的组策略对象 (GPO) 来配置大部分此信息。 例如,可以使用 GPO 将计算机配置为 NTP 服务器或 NTP 客户端、配置时间同步机制或将计算机配置为可靠的时间源。 还可以将 W32Time 的组策略设置应用于域控制器。

Windows 将 W32Time 策略信息存储在 计算机配置\管理模板\System\Windows 时间服务的本地组策略编辑器中。 它存储策略在 Windows 注册表中定义的配置信息,然后使用这些注册表项来配置特定于 W32Time 的注册表项。 因此,组策略定义的值将覆盖注册表的 W32Time 部分中任何预先存在的值。 某些预设 GPO 设置不同于相应的默认 W32Time 注册表项。

下表列出了可以为 W32Time 配置的策略及其影响的注册表子项的对应项。

Group Policy Registry locations1,2
全局配置设置 W32Time
W32Time\Config
W32Time\Parameters
时间提供程序\配置 Windows NTP 客户端 W32Time\TimeProviders\NtpClient
时间提供程序\启用 Windows NTP 客户端 W32Time\TimeProviders\NtpClient
时间提供程序\启用 Windows NTP 服务器 W32Time\TimeProviders\NtpServer

1 Subkey: HKLM\SOFTWARE\Policies\Microsoft
2 Subkey: HKLM\SYSTEM\CurrentControlSet\Services\W32Time

Note

删除组策略设置后,Windows 会从注册表的策略区域中删除相应的条目。

W32Time 的 GPO 默认设置

下表列出了启用 全局配置设置 时的默认值:

组策略设置 Default value
AnnounceFlags 10
ChainDisable 0
ChainEntryTimeout 16
ChainLoggingRate 30
ChainMaxEntries 128
ChainMaxHostEntries 4
ClockAdjustmentAuditLimit 800
ClockHoldoverPeriod 7,800
EventLogFlags 2
FrequencyCorrectRate 4
HoldPeriod 5
LargePhaseOffset 50,000,000
LocalClockDispersion 10
MaxAllowedPhaseOffset 300
MaxNegPhaseCorrection 172,800(48 小时)
MaxPollInterval 10
MaxPosPhaseCorrection 172,800(48 小时)
MinPollInterval 6
PhaseCorrectRate 1
PollAdjustFactor 5
RequireSecureTimeSyncRequests 0
SpikeWatchPeriod 900
UpdateInterval 100(1 秒)
UtilizeSslTimeData 1

NTP 客户端的 GPO 设置

下表列出了 计算机配置\管理模板\系统\Windows 时间服务\时间提供程序\配置 Windows NTP 客户端中的默认 Windows NTP 客户端设置。

组策略设置 Default value
NtpServer time.windows.com、0x9
类型 NT5DS: Used for domain-joined computers
NTP: Used for non-domain-joined computers
CrossSiteSyncFlags 2
ResolvePeerBackoffMinutes 15
ResolvePeerBackoffMaxTimes 7
SpecialPollInterval 1024
EventLogFlags 0

Note

如果使用组策略将值设置为NtpServer配置 Windows NTP 客户端策略的一部分,并将其应用于域成员,则 W32Time 不使用NtpServer注册表值。 若要查看 NTP 配置,请打开命令提示符并运行以下命令: w32tm /query /configuration

W32Time 注册表参考

W32Time 将信息存储在以下注册表路径下:

HKLM\SYSTEM\CurrentControlSet\Services\W32Time
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient
HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer

Warning

在排除故障或进行验证时,可参考本信息。 W32Time 使用 Windows 注册表项来存储关键信息。 请勿更改这些值。 在应用注册表之前,注册表编辑器或 Windows 不会验证对注册表的修改。 如果注册表包含无效值,Windows 可能会遇到无法恢复的错误。

注册表中的某些参数以时钟计时周期度量,某些参数以秒为单位度量。 若要在两个单元之间进行转换,请参阅前面“ 配置计算机时钟重置”中的说明。

In the following table, All versions refers to all supported versions of Windows and Windows Server.

Registry entry Versions Description
AnnounceFlags All versions 控制是否将此计算机标记为可靠的时间服务器。 除非将计算机标记为时间服务器,否则不会将其标记为可靠。

  • 0x00: Not time server
  • 0x01: Always time server
  • 0x02: Automatic time server
  • 0x04: Always-reliable time server
  • 0x08: Automatic reliable time server

The default value for domain members is 10. The default value for stand-alone clients and servers is 10.

ClockAdjustmentAuditLimit Windows Server 2016 版本 1709 及更高版本;Windows 10 版本 1709 及更高版本 指定可记录到目标计算机上的 W32Time 事件日志的最小本地时钟调整。 The default value is 800 parts per million (ppm).
ClockHoldoverPeriod Windows Server 2016 版本 1709 及更高版本;Windows 10 版本 1709 及更高版本 指示在不与时间源同步的情况下,系统时钟可以在名义上保持其准确性的最大秒数。 如果这段时间已过,而 W32Time 未从任何输入提供程序获取新示例,W32Time 就会开始重新发现时间源。 The default value is 7,800 seconds.
EventLogFlags All versions 控制时间服务记录哪些事件。

  • 0x1: Time jump
  • 0x2: Source change

The default value on domain members is 2. The default value on stand-alone clients and servers is 2.

FrequencyCorrectRate All versions 控制校正时钟的速率。 如果此值太小,则时钟不稳定,并且出现过度校正。 如果值太大,则时钟需要很长时间才能同步。 The default value on domain members is 4. The default value on stand-alone clients and servers is 4.

Zero isn't a valid value for the FrequencyCorrectRate registry entry.

HoldPeriod All versions 控制禁用峰值检测以使本地时钟快速进入同步状态的时间段。 峰值是一个时间样本,表示时间偏差了几秒,并且在持续返回良好时间样本后才会收到。 The default value on domain members is 5. The default value on stand-alone clients and servers is 5.
LargePhaseOffset All versions Specifies that a time offset greater than or equal to this value in 10-7 seconds is considered a spike. 网络干扰(如流量过大)可能会导致出现峰值。 除非持续很长时间,否则将忽略峰值。 The default value on domain members is 50,000,000. The default value on stand-alone clients and servers is 50,000,000.
LocalClockDispersion All versions 控制在唯一时间源为内置 CMOS 时钟时必须采用的离差(以秒为单位)。 The default value on domain members is 10. The default value on stand-alone clients and servers is 10.
MaxAllowedPhaseOffset All versions 指定 W32Time 尝试使用时钟速率调整计算机时钟的最大偏移量(以秒为单位)。 当偏移量超过此速率时,W32Time 会直接设置计算机时钟。 The default value for domain members is 300. The default value for stand-alone clients and servers is 1.
MaxClockRate All versions 由 W32Time 维护。 它包含 Windows作系统使用的保留数据,对此设置所做的任何更改都可能导致不可预知的结果。 The default value for domain members is 155,860. The default value for stand-alone clients and servers is 155,860.
MaxNegPhaseCorrection All versions 指定服务可以进行的最大负向时间校正(以秒为单位)。 如果服务确定需要大于此值的更改,则会改为记录事件。

The value 0xFFFFFFFF is a special case. 此值表示服务始终校正时间。

The default value for domain members is 0xFFFFFFFF (hexadecimal). The default value for domain controllers is 172,800 (48 hrs). The default value for stand-alone clients and servers is 54,000 (15 hrs).

MaxPollInterval All versions 指定系统轮询间隔允许的最大间隔(以 log2 秒为单位)。 系统必须根据预定的间隔轮询。 提供商在请求这样做时可以拒绝生成样本。 The default value for domain controllers is 10. The default value for domain members is 15. The default value for stand-alone clients and servers is 15.
MaxPosPhaseCorrection All versions 指定服务可以进行的最大正向时间校正(以秒为单位)。 如果服务确定需要大于此值的更改,则会改为记录事件。

The value 0xFFFFFFFF is a special case. 此值表示服务始终校正时间。

The default value for domain members is 0xFFFFFFFF (hexadecimal). The default value for domain controllers is 172,800 (48 hrs). The default value for stand-alone clients and servers is 54,000 (15 hrs).

MinClockRate All versions 由 W32Time 维护。 它包含 Windows作系统使用的保留数据,对此设置所做的任何更改都可能导致不可预知的结果。 The default value for domain members is 155,860. The default value for stand-alone clients and servers is 155,860.
MinPollInterval All versions 指定系统轮询间隔允许的最小间隔(以 log2 秒为单位)。 系统不比此值更频繁地请求示例。 提供程序可以在计划间隔以外的时间生成示例。 The default value for domain controllers is 6. The default value for domain members is 10. The default value for stand-alone clients and servers is 10.
PhaseCorrectRate All versions 控制校正相位错误的速率。 指定小值可快速更正阶段错误,但可能导致时钟不稳定。 如果该值过大,则需要较长的时间来校正相位错误。

The default value on domain members is 1. The default value on stand-alone clients and servers is 7.

Zero isn't a valid value for the PhaseCorrectRate registry entry.

PollAdjustFactor All versions 控制是决定增大还是决定减小系统的轮询间隔。 值越大,导致轮询间隔减少的错误量就越小。 The default value on domain members is 5. The default value on stand-alone clients and servers is 5.
SpikeWatchPeriod All versions 指定可疑偏移量在被接受为正确偏移量之前必须持续的时间(以秒为单位)。 The default value on domain members is 900. The default value on stand-alone clients and workstations is 900.
TimeJumpAuditOffset All versions 指示时间跳转审核阈值(以秒为单位)。 偏移量存储为无符号整数。 如果时间服务通过直接设置时钟来调整本地时钟,并且时间更正大于此值,则时间服务会记录审核事件。
UpdateInterval All versions 指定相位校正调整之间的时钟计时周期数。 The default value for domain controllers is 100. The default value for domain members is 30,000. The default value for stand-alone clients and servers is 360,000.

Zero isn't a valid value for the UpdateInterval registry entry.

UtilizeSslTimeData Windows 10 版本 1511 之后的 Windows 版本 指示 W32Time 是否使用多个 SSL 时间戳来调整一个严重不准确的时钟。 A value of 1 indicates multiple SSL timestamps are used.

The UtilizeSslTimeData registry value refers to the secure time seeding feature. 有关详细信息,请参阅 安全时间播种 - 改进 Windows 中的时间管理

The default out-of-box value for all Windows versions with this feature is 1 except for Windows Server 2025, where the default value is 0. 域成员身份不会影响此设置。

Enhanced logging

以下注册表项不是 W32Time 默认配置的一部分,但你可以将它们添加到注册表以获取增强的日志记录功能。 You can modify the information that's logged to the system event log by adjusting the EventLogFlags settings in the Group Policy Object Editor. 默认情况下,W32Time 每次切换到新的时间源时都会记录事件。

若要启用增强的 W32Time 日志记录,请将以下注册表项添加到路径中 HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config

Entry Versions Description
FileLogEntries All versions 控制在 W32Time 日志文件中创建的条目数。 The default value is none, which results in no logs of W32Time activity. Valid values are 0 to 300. 此值不会影响 W32Time 通常创建的事件日志条目。
FileLogName All versions 控制 W32Time 日志的位置和文件名。 默认值为空。 It shouldn't be changed unless FileLogEntries is changed. 有效值是 W32Time 用于创建日志文件的完整路径和文件名。 此值不会影响 W32Time 通常创建的事件日志条目。
FileLogSize All versions 控制 W32Time 日志文件的循环日志记录行为。 When FileLogEntries and FileLogName are defined, this value is also defined. 它包含日志文件在用新条目覆盖最早日志条目之前可以达到的大小(以字节为单位)。 Use 1,000,000 or a larger value for this setting. 此值不会影响 W32Time 通常创建的事件日志条目。