Network Time Protocol (NTP) is a highly scalable internet protocol that determines the best time information and synchronizes accurate settings on a computer system. This guide explains how to set the time zone and configure NTP on a Windows Server.
This guide uses Windows Server 2019, but these instructions work on any machine with Server 2016 or later.
Before you begin:
powershell
in the search bar, and click OK to start PowerShell.Run the following command to check the server timezone.
PS > Get-Timezone
View all available timezones.
PS> Get-Timezone -ListAvailable
To find your target timezone, use the following command to filter by name.
PS> Get-Timezone -ListAvailable | Where-Object {$_.displayname -like "*US*"}
The command above displays all names containing the characters
US
. You can use a different string such as London.
Change your timezone.
PS> Set-Timezone -Name "Central Standard Time"
You can also change the timezone by ID.
PS> Set-Timezone -Id "Central Standard Time"
In addition to setting the timezone, you can also configure Windows to use NTP to synchronize the time.
regedit
and click OK to open Registry Editor.Expand the registry navigation tree:
HKEY_LOCAL_MACHINE -> SYSTEM -> CurrentControlSet -> Services
Expand W32Time.
5
in the Value data field.By default, Vultr uses the time.constant.com
time server, located on our high-speed infrastructure. If you want to use a different time server, you can change the value of the NtpServer
parameter by following these steps.
Change the value data field to your preferred value. For example, to sync with the United States NTP pool, use:
us.pool.ntp.org
You can find a list of NTP Pool servers at the official website.
Expand TimeProviders.
0
to 1
, and click OK to save changes.services
.In the services window, scroll through the list, select Windows Time, right-click, and select Restart to apply NTP changes.
If you prefer to use Powershell, you can use the following commands to configure NTP.
Check the NTP time synchronization status.
PS> w32tm /query /status
Enter the following command to set the time AnnounceFlags to 5
.
PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\W32Time\Config" -Name "AnnounceFlags" -Value 5
(Optional) If you want to use NTP pool servers instead of Vultr's NTP server, run the following command.
PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\Parameters" -Name "NtpServer" -Value us.pool.ntp.org
Enable NTP Server.
PS> Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\w32time\TimeProviders\NtpServer" -Name "Enabled" -Value 1
Restart the Windows Time service.
PS> Restart-Service w32Time
Test NTP synchronization.
PS> w32tm /resync
You have successfully set the timezone and configured NTP on Windows Server 2019. If you plan to have other machines on a Vultr VPC use your NTP server, allow port 123
in the Windows Server Firewall. For further information, refer to the following guides.