I'm running an iMac with OS X Leopard, and the Windows 7 Release Candidate (using bootcamp). Sometimes when I boot into Windows, and then boot back into OSX, I find that Windows has changed the system's clock to use an incorrect time. I've had this problem when using Vista with bootcamp too.

4 Answers
4

Edit: After a few days of using the method I originally posted, I discovered that the RealTimeIsUniversal flag, as an unmaintained leftover from Windows NT, is actually pretty flaky and impractical in general. Every so often, at seemingly random intervals, the Windows clock would revert from UTC to local time, which was extremely annoying (and resulted in a few git commits that look like they're from the future in the commit log). This led me to search for another fix…

In general, the problem is that, as John Fouhy mentioned in a comment, Windows keeps the clock in local time, while OS X keeps the clock at UTC (using the specified timezone as a modifier to give the correct time). In order to fix this, one of the operating systems will have to bend over backwards and keep track of time using the other system's method.

Now, the most reliable method I've found to fix this issue so far is to basically make OS X switch its clock to local time from UTC whenever it shuts down and then switch it back whenever it starts up. The exact method for doing this can be found on the OSx86 project wiki, interestingly enough. (A little note: there's some stuff that appears to be OSx86-specific, namely the LaunchDaemon plist for the Leopard instructions. However, I tried out the Leopard method verbatim on my MacBook Pro, and it works just fine. In other words, just follow the directions exactly as written, and don't mind any references to OSx86 in the files—they're irrelevant.)

Here is the old solution, if you want to try it out. Be warned though: this was never updated to work correctly with newer versions of Windows, so it's very unreliable, as I found out the hard way…

Another way of syncing the clocks is to force Windows to use UTC through a registry hack (a trick I found from Mac OS X Hints):

Launch RegEdit (Start -> Run..., type in regedit)

Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation".

From the Edit menu, choose New -> DWORD Value.

Name this value "RealTimeIsUniversal".

Double-click on RealTimeIsUniversal, and enter 1 for the value data.

The next time you boot into Windows, the clock should match the Mac OS X clock, and you can still have the Windows timezone match the timezone set in Mac OS X.

Check to make sure you are using the same time zone on both operating systems. If one has a different time zone, it might change the system clock to show its time zone, which would be different that the other OS's time.

Macs (like linux/unix) keep the system clock at UTC and apply the timezone as a modifier for display. Windows keeps the system clock at local time. Hence, if Windows realises its clock is "wrong", it will fix it. One workaround therefore would be to deliberately set your Windows timezone to UTC.
–
John FouhyJul 23 '09 at 0:48