Sync Time or Change NTP Server in Windows 11 using CMD

Published by Nyau Wai Hoe - Updated on

Keeping your computer’s clock on point may seem like no biggie, but trust me, it’s super important for keeping your system working properly. This is super true for businesses that need their timestamps to be spot on for stuff like log files, keeping data in sync, and for security stuff. In this guide, we’re going to walk through how to make sure your Windows 11 clock is syncing up with an internet time server, how to switch up your Network Time Protocol (NTP) server, and how to refresh your NTP time using the command prompt (CMD).

Also see: How to Change Date and Time Format in Windows 11

Sync Time or Update NTP Server in Windows 11 using CMD

Why keeping time right on your PC is important

Having your computer’s clock synced isn’t just about the right time showing on your taskbar. It’s super important for a bunch of computer tasks like managing files, scheduling stuff, network authentication, and logging what’s happening. It makes sure everything works together smoothly and in order, which is a big deal when your computer’s part of a network.

Windows 11, just like the ones before it, uses the Network Time Protocol (NTP) to keep its clock in line with external time servers. By default, it sticks with time.windows.com, but there are loads of other public NTP servers out there.

Linked issue: Date and Time is Always Wrong in Windows

How to sync your Windows 11 time with the internet using CMD

If you want to make sure your system’s time is correct, Windows 11 lets you sync it up with an internet time server. Here’s how you can get that working using CMD:

  1. Start by opening the Command Prompt as an admin. Just search for “cmd” or “command prompt” in the Start menu, right-click on “Command Prompt” in the search results, and pick “Run as administrator” from the menu that pops up.
  2. With the Command Prompt window open, enter the following command:
    w32tm /resync

    Sync Time Command Prompt Windows 11

  3. Hit the Enter key after you type in the command. If all goes well, you’ll see a message saying the command worked. This step gets your system’s clock in sync with the default internet time server.

This feature can also help sort out issues if your computer’s clock is running slow or fast, making sure your computer’s time is as right as rain.

Related resource: How to Change Date and Time Format in Windows 11

How to switch your NTP time server in Windows 11

Normally, your Windows system keeps its clock in check with Microsoft’s time server. But sometimes, you might need to sync with a different NTP server, like if the default one isn’t reachable, or you prefer using a local time server in your network. Here’s the lowdown on how to make the switch using CMD:

  1. Start the Command Prompt as an administrator, just like before.
  2. In the Command Prompt window, pop in the following command to change the NTP server. Swap “time.nist.gov” with your chosen NTP server’s address:
    w32tm /config /syncfromflags:manual /manualpeerlist:time.nist.gov

    Change NTP Time Server using CMD in Windows 11

  3. Hit the Enter key after you enter the command. This changes your NTP server to the one you picked.
  4. To make sure the changes stick, type this command and press Enter:
    w32tm /config /update

    Update time server command prompt Windows 11

  5. Then, get your system’s clock synced up with the new NTP server by using the w32tm /resync command.

How to refresh your NTP time

Refreshing your NTP time in Windows is just a matter of making it resync. Just follow the steps in “How to sync your Windows 11 Clock using CMD” and run the “w32tm /resync” command to get your system clock updated or fixed whenever you need.

What to do if you run into time sync issues

Even if you follow the steps exactly, you might run into problems with the time sync process. Like, you might see an error when trying to use the w32tm /resync command. Common errors include messages like “The service has not been started (0x80070426)” or “The computer did not resync because the time service was shutting down.”

If that happens, try this command to restart the w32time service, which can often kick any time syncing issues to the curb in Windows 11 or 10:

net stop w32time
net start w32time

After the service is back up and running, give the time sync another go with the w32tm /resync command.

Stop and restart time service in Windows 11 via CMD

If restarting doesn’t smooth things over, consider unregistering and then re-registering the time service in Windows with these steps:

  1. First, start by unregistering the Windows Time Service with this command: w32tm /unregister.
  2. Then, stop the Windows Time Service using this command: net stop w32time.
  3. Next up, re-register the Windows Time Service with this command: w32tm /register.
  4. Finally, get the Windows Time Service going again with: net start w32time.

Unregister and register w32tm time service in Windows 11 via CMD

Running through these steps helps you to unregister, stop, re-register, and restart the Windows Time Service, fixing any issues in the process.

So, what have we learned?

It might not seem like a big deal, but keeping your computer’s clock accurate is utterly important for keeping things running correctly and smoothly, especially when you’re working in a bigger network. Whether you’re fixing a time issue or just making sure your clock is accurate, these commands should help you out.

Plus, opting for CMD instead of the graphical user interface (GUI) has its perks. Using the command line lets you automate these tasks, which is a lifesaver for folks managing more than one machine (for example, network admins). You can set up scripts with these commands to run at certain times, making sure your time sync is always on point. And since you can do CMD commands remotely, it’s a flexible choice for working with networks.

Categories: ComputingWindows 11

Nyau Wai Hoe
Nyau Wai Hoe is the Founder and Chief Editor of WindowsDigitals.com. With a degree in software engineering and over 12 years of experience in the tech support industry, Nyau has established himself as an expert in the field, with a primary focus on the Microsoft Windows operating system. As a tech enthusiast, he loves exploring new technologies and leveraging them to solve real-life problems.

Share via
Copy link