NTP is used in recent projects. Some problems are encountered during use. The special records are as follows:
(1) NTP server section
To configure an internal time server to synchronize with an external time source, follow these steps:
1. Change the server type to NTP. To do this, follow these steps:
A. Click Start, click Run, type regedit, and click OK ".
B. Locate and click the following registry subitem:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ Parameters \ type
C. In the right pane, right-click "type" and click "modify ".
D. in the edit Value Field, type NTP in the value data box, and click OK ".
2. Set announceflags to 5. To do this, follow these steps:
A. Locate and click the following registry subitem:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ config \ announceflags
B. In the right pane, right-click announceflags and click Modify ".
C. Type 5 in the "Edit DWORD Value" field and click "OK ".
3. Enable ntpserver. To do this, follow these steps:
A. Locate and click the following registry subitem:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ timeproviders \ ntpserver
B. In the right pane, right-click enabled and click Modify ".
C. In the Edit DWORD Value Field, type 1 in the value data box, and click OK ".
4. specify the time source. To do this, follow these steps:
A. Locate and click the following registry subitem:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ Parameters
B. In the right pane, right-click ntpserver and click Modify ".
C. In the edit Value Field, type peers in the value data box, and click OK ".
Note: peers is a placeholder and should be replaced with the peer list (separated by spaces) from which your computer obtains the timestamp ). Each DNS name listed must be unique. Each DNS name must be appended with 0x1. If it is not appended after each DNS name, 0x1, the changes made in step 5 will not take effect.
5. Select the polling interval. To do this, follow these steps:
. locate and click the following registry subitem:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ timeproviders \ ntpclient \ specialpollinterval
B. in the right pane, right-click specialpollinterval and click Modify ".
C. Type timeinseconds in the "Edit DWORD Value" value data box and click "OK ".
Note: timeinseconds is a placeholder and should be replaced with the number of seconds between polling. The recommended value is 900 (decimal ). This value configures the time server to poll every 15 minutes.
6. Configure time calibration settings. To do this, follow these steps:
. locate and click the following registry subitem:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ config \ maxposphasecorrection
B. in the right pane, right-click maxposphasecorrection and click Modify ".
C. Click "base" in "Edit DWORD Value" to select "decimal ".
D. Type timeinseconds in the "Edit DWORD Value" value data box and click "OK ".
Note: timeinseconds is a placeholder and should be replaced with an appropriate value, such as 1 hour (3600) or 30 minutes (1800 ). The value you selected varies with the polling interval, network condition, and external time source.
E. Locate and click the following registry subitem: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ w32time \ config \ maxnegphasecorrection
F. In the right pane, right-click "maxnegphasecorrection" and click "modify ".
G. click in the "base" box of "Edit DWORD Value" to select "decimal ".
H. Type timeinseconds in the value data box of "Edit DWORD Value" and click "OK ".
Note: timeinseconds is a placeholder and should be replaced with an appropriate value, such as 1 hour (3600) or 30 minutes (1800 ). The value you selected varies with the polling interval, network condition, and external time source.
7. Exit the Registry Editor.
8. at the command prompt, type the following command to restart Windows Time Service, and then press Enter:
Net stop w32time & Net start w32time
(2) NTP client
To use NTP, make sure that the Windows Time Service is started.
Set the default NTP address for Windows
Set the default value in the Registry's HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ datetime \ servers.
In dos, you can call the following command to perform time synchronization.
NET Time/setsntp: 192.168.1.20.---- (set the time server address)
Net stop w32time --- (Stop Time Service)
Net start w32time --- (Start Time Service)
W32tm-s --- (synchronize time now)