Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

How do I prevent this from happening?

share|improve this question
add comment

4 Answers

up vote 16 down vote accepted

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):

  1. Launch RegEdit (Start -> Run..., type in regedit)
  2. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation".
  3. From the Edit menu, choose New -> DWORD Value.
  4. Name this value "RealTimeIsUniversal".
  5. 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.

share|improve this answer
    
Wow, great tip for those dual boot situations! –  Greg Hewgill Jul 23 '09 at 1:43
    
I've been using the registry hack under Windows 7 for the past few weeks. So far, so good. It even changed over properly during the switch from daylight saving time. –  kdmurray Nov 1 '09 at 9:17
add comment

Check your clock sync settings in Windows. It may be adjusting the clock with an internet source and changing the clock.

share|improve this answer
    
I had this problem - OS X was set to GMT+1, and I had forgotten Windows was still set to GMT+9.5.. –  dbr Jul 25 '09 at 12:09
add comment

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.

share|improve this answer
2  
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 Fouhy Jul 23 '09 at 0:48
add comment

I have a login script on the Mac side of things -- Leopard in my case -- that is a simple shell script to set the clock via the Internet:

#!/bin/sh
ntpdate -uvs time.apple.com
exit 0

So when you boot into Windows it send the clock 5 hours forward if you are on the east coast and when you reboot into Mac OS X it sets the clock back to UTC.

Cheers...

Jim Ferr

share|improve this answer
    
How do you set this to run automatically at login? –  Brian Willis Oct 13 '09 at 7:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.