If an authoritative time server that is configured to use an AnnounceFlag value of 0x5 and to synchronize with an upstream time server at a fixed interval that is specified in SpecialPollInterval, a client server may not correctly synchronize with the authoritative time server after the authoritative time server restarts. Keeping your System Time accurate is very important. Learn how to change the Time Server in Windows 10 & how to add new additional Time Servers of your choice.
Active1 year, 8 months ago
I need to verify the current NTP configuration on some Windows systems. Ideally, I'd like to be able to do this via command line instead of navigating through configuration screens.
(I'm working on several different OS versions, and configuration screens tend to not always be in the same place across versions.)
I'm hoping to find a quick, memorable command that I can just punch into a CMD console to get the result. A batch file I can carry around with me will do just as well, though.
Specifically, I need the following:
- Show whether or not the system is configured to receive time from an NTP server.
- Show the NTP server(s) the system is receiving time from.
- Show the time of the last synchronization.
- Show the current time on the system.
What command(s) would be necessary to achieve these results?
Looking for a solution that's cross-compatible with Windows XP, 7, Server 2003, and Server 2008.
fixer123422.3k1414 gold badges5656 silver badges8989 bronze badges
IsziIszi7,6783737 gold badges9696 silver badges164164 bronze badges
6 Answers
In the command line, type
w32tm /query /configuration
gives you the configuration you have set up.w32tm /query /status
gives you information such as:- stratum
- leap indicator
- precision
- last sync
- NTP server
- poll interval
time /T
outputs the current system time.Note:
Pacerierw32tm /query
was first made available in the Windows Time client versions of Windows Vista, and Windows Server 2008. See Windows Time Service Tools and Settings11.8k7070 gold badges164164 silver badges248248 bronze badges
Phillip R.Phillip R.
This answers your last question:
Open a command prompt and type exactly:
w32tm /stripchart /computer:NTPServerNameOrIP /dataonly /samples:x
(how many returns you want)It returns time and difference to NTP server time. If it returns time, error: 0x80072746 then that is not your NTP server.
An example of a command is below:
Peter Mortensen8,5881616 gold badges6262 silver badges8585 bronze badges
ByronByron
I tried:
I got:
In a different machine, I got:
Then I tried:
I got:
Then I tried:
I got:
Windows 10 Check Ntp Server
In another machine, I got the help page, saying also:
So, basically, the service was not running. Following these instructions, I did:
Finally, all the above would work. (note: if
net start
fails, see below) Then I just needed to set my ntp up...I did it with:following instructions from here, but perhaps it could've been as easy as:
as instructed here. (10.0.0.5 being my local NTP server). If you're not using a local NTP server, you can use the generic one:
Finally, you might need to do the following, which was not necessary for me:
NOTE: if
net start w32time
fails with error 1290 (The service start failed since one or more services in the same process have an incompatible service SID type setting) then follow the steps here:Then follow as above.
NOTE 2: if the NTP service doesn't automatically start on reboot, it might be due to its start settings, as described here: depending on your windows, it might be set to start only when it joins a domain. You can check with:
If it's configured to start when you join a domain, and you don't have a domain set up in your machine, it will not start the service and set the time. It probably doesn't join a domain because you don't want it to. In any case, just change which trigger starts it. For example, to start when the machine has network (and therefore is able to access the server), do:
msbmsb1,07711 gold badge1313 silver badges1919 bronze badges
Use:
A .bat sample file is at https://gist.github.com/thedom85/dbeb58627adfb3d5c3af.
I also recommend this program: http://www.timesynctool.com/
Peter Mortensen8,5881616 gold badges6262 silver badges8585 bronze badges
user565386user565386
From the command line you can get the info like this:
Seems like that should be enough at least to get going in that direction, that is, if I understood your question. AFAIK, the 'reg' command works on all these different platformsso long as you have the right services running.
osirisgothraosirisgothra
Take a look at the
Peter Mortensenw32tm
command-line tool. It can set and query the configuration and report a /stripchart of the time offset with another computer.8,5881616 gold badges6262 silver badges8585 bronze badges
uSlackruSlackr
Not the answer you're looking for? Browse other questions tagged windowscommand-linebatch-filedate-timentp or ask your own question.
Windows 10 uses the Network Time Protocol (NTP) to connect with time servers on the internet to provide accurate system time. Otherwise, if the clock is not correctly synchronized, you could experience network issues, and documents and other files you create may end with incorrect time stamps.
Although for the most part, the default time server is reliable, there will be times when you may need to change it, such as if your current configuration causes your device to display the wrong time, you just prefer to use a different service, or your company uses a specific configuration.
Whatever the reason, on Windows 10 it's possible to switch time providers, and you can even add custom time servers to the list as necessary.
In this Windows 10 guide, we walk you through the steps to use different time servers to make sure that your computer is getting the correct time using Control Panel.
How to change the time server on Windows 10
- Open Control Panel.
- Click on Clock, Language, and Region.
- Click on Date and Time.
- Click on the Internet Time tab.
- Click the Change settings button.
- Check that the Synchronize with an internet time server option is selected.
- Use the drop-down menu to select a different server.
- Click the Update now button to synchronize the time with the new server.
- Click OK.
- Click Apply.
- Click OK.
After completing the steps, Windows 10 will keep the time synchronized over the internet with the server you selected.
How to add new time servers on Windows 10
![Windows 10 Ntp Server Windows 10 Ntp Server](/uploads/1/2/6/1/126136053/303307837.png)
If you prefer to use a different time server that isn't in the list, it's also possible to include any NTP server you want.
- Open Control Panel.
- Click on Clock, Language, and Region.
- Click on Date and Time.
- Click on the Internet Time tab.
- Click the Change settings button.
- Check that the Synchronize with an internet time server option is selected.
- Click the drop-down menu, and next to 'Server,' and type the new address of the time server.
- Click the Update now button to resynchronize.
- Click OK.
- Click Apply.
- Click OK.
After adding the new configuration, you can quickly verify everything is working as expected by checking the Internet Time tab, which now should include a 'The clock was successfully synchronized' message with the link to the NTP server and date and time of the synchronization.
Adding new time servers using the Registry
Using Control Panel, you can change the Internet Time settings to anything, but the list only allows you to store one extra entry. If you want to add multiple addresses to the list, you'll need to use the Registry.
Warning: This is a friendly reminder that editing the Registry is risky, and it can cause irreversible damage to your installation if you don't do it correctly. It's recommended to make a full backup of your PC before proceeding.
- Use the Windows key + R keyboard shortcut to open the Run command.
- Type regedit, and click OK to open the Registry.
- Browse the following path:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionDateTimeServers
- On the right side, right-click on the Servers (folder) key, select New, and click on String Value.
- Type a number that corresponds to the position of the new entry in the server drop-down menu in Control Panel.
- Double-click the newly created String Value.
- Type the address of Network Time Protocol (NTP) server. For example, if you want to use the Google Public NTP server, you can enter time.google.com.
- Click OK.
Once you completed the steps, you can use the instructions to change the time server, but on step No. 6 select the newly added server and don't forget to click the Update now button.
![Server Server](/uploads/1/2/6/1/126136053/718172766.png)
How to troubleshoot time server synchronization problems
If after changing the settings, your device still has problems connecting to the NTP server, you can reset the Windows Time service configurations using Command Prompt.
- Open the Start menu.
- Search for cmd.exe, right-click the result, and select Run as administrator.
- Type the following command to disable the Windows Time service and press Enter:
net stop w32time
- Type the following command to unregister the Windows Time service and to remove all settings information from the registry and press Enter:
w32tm /unregister
- Type the following command to register the Windows Time service and to load the default settings to the registry and press Enter:
w32tm /register
- Type the following command to start the Windows Time service and press Enter:
net start w32time
- Type the following command to force your computer to synchronize your computer without waiting and press Enter:
w32tm /resync /nowait
- Restart your computer.
Once you completed the steps, your device should now synchronize with its clock over the internet.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources: