You are viewing mackys

Adventures in Engineering - Network time synchronization on Windows the (relatively) easy way.
The wanderings of a modern ronin.

Ben Cantrick
  Date: 2011-10-21 12:32
  Subject:   Network time synchronization on Windows the (relatively) easy way.
Public
  Mood:temporally accurate
  Music:Morris Day and The Time - Get It Up

Ever wondered if you can synchronize your Windows (2000 or later) computer's clock with an NTP server? Yes, you can download NTP synchronizer program if you want. But I am lazy and hate waiting for downloads, so I wanted to do this with just stuff that ships with Win7.

Turns out you can synchronize with time.windows.com, which is accurate to approximately 1.5 seconds. If that's good enough for you, here's a way to do it without downloading anything:

First, click on the Start menu at lower-left. Type in "cmd". Windows will show you a "cmd.exe" program. Right-click on it and then click "Run as administrator". Now a special "administrator" command prompt will come up. Type in:

net start w32time

w32tm /config /update /manualpeerlist:time.windows.com

w32tm /resync

net stop w32time


The "net start" command starts a windows service that synchronizes clocks, the "w32tm /config" commands tells it you want to synchronize with time.microsoft.com, the "w32tm /resync" command says "okay, actually do a sync now", and finally the "net stop" command shuts down the sync service, since the clock has successfully been sync'd.

It's a lot more convoluted and annoying than Linux's "ntpdate", but I guess that's Windows for you. :P If you anticipate doing this frequently, by all means cut and paste the above into a batch file named "synctime.bat" or whatever. Just remember that you need to run it as administrator, or it won't work.


Google-bait: NTP server manual time synchronization windows
Post A Comment | Share | Link






browse
September 2014