I’ve been running Parallels on my MacBook so I can boot up a few of the Windows applications I still rely on… which I can tell you is a dwindling number. I noticed a few weeks ago that the clock in Windows XP had gone out of sync on the machine. Basically, if the virtual machine was not running, the Windows clock was completely asleep.
For the first few weeks of running Parallels, I solved this by writing a very simple .bat file that would execute at startup of Windows XP. It ran the Windows time manager and told it to check one of the time servers on the Internet and reset the time on my laptop. I don’t run on a domain or any fancy network at home, so I don’t have a local server I can use for syncing the time.
Anyway, here’s how to set that up:
- Open a new text file in Notepad
- Paste the following command (without the quotes) into the file: “w32tm /resync /rediscover”
- Save the file as synctime.bat. You may find that Notepad automatically helps you by adding on the default .txt extension. If that happens, just rename the file and take off that extension.
- Put the file somewhere in your path, maybe c:Windowssystem32.
- Create a shortcut to the synctime.bat file and put it into your Startup folder.
When the operating system is restarted, a command prompt will briefly appear showing the w32tm process running, and then it should go away after your clock has been updated.
Well… not exactly. After running this for a few weeks with no trouble, I found that the clock was no longer updating. I opened the command prompt today and entered the w32tm command manually and found the following error:
The computer did not resync because the required time change was too big.
A quick Google search landed me at Microsoft’s TechNet article for Windows Time Service Tools and Settings, which provides in-depth detail on the switches and parameters for using the w32tm utility. Since I’m not running my own time server, most of it was irrelevant to me. I found a couple of registry settings that would correct the issue. These are MaxNegPhaseCorrection and MaxPosPhaseCorrection, and they are found in the registry at:
The default (decimal) value for both of these keys was 54,000, which is 15 hours. This means that if your local clock and the Internet clock that you are syncing to are within 15 hours of each other, the time on your PC will be updated. If they are more than 15 hours apart, forget it.
The TechNet article highlighted a special case for this setting: “0xFFFFFFFF means always make time correction.” So fixing this issue is just a matter of editing a couple of Registry keys.
- Open up the Registry Editor. (From your Start Menu, select “run” and enter “regedit”.)
- Browse down to the “config” key to find the phase correction settings.
- Double-click on MaxNegPhaseCorrection to edit the value. It will read “d2f0” in the hexidecimal value, or 54000 in the decimal value. Select “hexidecimal” and enter “ffffffff” in the field.
- Click “OK”.
- Make the same change for MaxPosPhaseCorrection.
- Close the Registry Editor
Re-run the synctime.bat file and you should fine that the time in Windows has been updated.
If there is a better way to do this, or a different setting that should be used, I’m happy to hear about it. This seems to have fixed my problem with time syncing in Windows, but I’m also pretty new to how Windows manages time syncing on a local network or on a managed domain.
If you have a better suggestion, please post it in the comments area below.