This topic describes how to enable and configure the NTP service for a Windows instance to ensure the local system time is synchronized precisely.

Background information

ECS instances in all Alibaba Cloud regions use UTC+8 by default. You can also configure or modify time zones for your instances as needed.

This topic uses Windows Server 2012 R2 Datacenter Edition 64-bit as an example to describe how to use the NTP service to synchronize the local system time for Windows instances.

Enable the NTP service

By default, the Windows Time service is enabled on Windows Server operating systems. Therefore, the NTP service must be enabled for Windows instances to synchronize the local system time. To check and enable the NTP service, perform the following operations:

  1. Connect to a Windows instance.
  2. Click Start and open the Run dialog box. Run the services.msc command in the dialog box.
  3. In the Services dialog box that appears, find and double-click Windows Time.
  4. In the Windows Time Properties (Local Computer) dialog box that appears, perform the following operations:
    1. Select Automatic for Startup type.
    2. Ensure that the value of Service status is Running. Otherwise, click Start.
    3. Click Apply and click OK.

Modify the default NTP server address

By default, Windows Server operating systems use the Microsoft NTP server (time.windows.com), but synchronization errors may occur. When you use a Windows instance, you can replace the default NTP server with the intranet NTP server provided by Alibaba Cloud. To modify the default NTP server address, perform the following operations:

  1. Connect to a Windows instance.
  2. In the notification area of the taskbar, click the date and time and click Change date and time settings.
  3. In the Date and Time dialog box that appears, click the Internet Time tab and click Change settings.
  4. In the Internet Time Settings dialog box that appears, select Synchronize with an Internet time server and enter an Alibaba Cloud intranet NTP server address. Click Update now. For more information, see Alibaba Cloud NTP server.

Modify the NTP synchronization interval

The default NTP synchronization interval is five minutes, you can modify it as needed. To modify the NTP synchronization interval, perform the following operations:

  1. Connect to a Windows instance.
  2. Click Start and open the Run dialog box. Run the regedit command in the dialog box.
  3. In the left-side navigation pane of the Registry Editor, choose HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > W32Time > TimeProviders > NtpClient and double-click SpecialPollInterval.
  4. In the Edit DWORD (32-bit) Value dialog box that appears, select Decimal in the Base section and enter the required value in the Value data field. The required value is the new synchronization interval. Unit: seconds.
  5. Click OK.