Jump to content

Fixing Time Synchronization


  • Please log in to reply
10 replies to this topic

#1
speedy859

speedy859

    InsanelyMac Protégé

  • Members
  • Pip
  • 9 posts
Most people have probably noticed how the clocks of OS X and Windows (at least, windows xp, i don't know about vista) are always wrong after rebooting from one OS into the other (unless you live at GMT). This is because of the way OS X and Windows read the time from the BIOS.

I found the fix to this problem here, but it doesn't work entirely: http://wiki.osx86pro...iversal_for_RTC

The first method seemed the best to me, but it had a few issues:

[Skip to the dashed line if you just want my final solution. My only new contribution are two modifications to the original procedure detailed in the wiki]

1. The way it works is that on boot OS X sets its own local time to the BIOS time (what OS X thinks is UTC). On shut down, OS X then sets UTC to be the current time, so that the BIOS clock will match local time (in other words, it saves local time into the BIOS). This probably seems a little confusing, so here's an example:

Let's say we're in GMT -5 (aka U.S. Eastern Time). Booting up the comp, the BIOS reads 11:00 AM. Starting up OS X, the date command is run -> 11:00 AM becomes local time. Without that date command, OS X would think that is 6:00 AM. Anyway, we do our stuff, then restart the comp to use Windows. Let's say its 11:10 AM at this point. If OS X shows 11:10 AM, that means in the BIOS right now it reads 4:10 PM. The second date command sets the BIOS time to 11:10 AM. Without this date command, Windows would show the time as 4:10 PM instead of 11:10 AM.

The issue is that the date commands on the wiki don't set seconds. If it is 11:00:55 in the BIOS, the first date command makes it 11:00:00 in OS X. Of course, this isn't a huge problem, but it annoyed me.

2. If you leave automatic time synchronization enabled in OS X, it seems sometimes the synchronization will run before the first date command while booting. This causes time to actually get further messed up. Example: It is 11:00 AM in the BIOS. OS X synchronizes to 11:00 AM local time before the first date command is run, which means it is now 4:00 PM in the BIOS. the date command then runs, setting local time to match BIOS time, which means OS X now displays 4:00 PM when it is really 11:00 AM.

Anyway, fixing the second issue is easy; just turn off time synchronization in OS X. However, without fixing the first issue, this means that with enough reboots the time will be significantly off. I managed to figure out modifications to the two date commands that will allow them to set seconds as well, fixing the first issue.

-------------------------------------------------------------------------------------------------------------------------------
-Open terminal.
-Type "sudo nano /etc/rc.local" without the quotes. The file likely doesn't exist, so you'll be creating a new one.
-paste this line to the file:

date `date -u +%m%d%H%M%Y.%S`

-press Ctrl-O, then enter to save. press Ctrl-X to get back to terminal.

-type "sudo nano /etc/rc.shutdown.local" without the quotes. Again, the file probably doesn't exist.
-paste this line to the file:

date -u `date +%m%d%H%M%Y.%S`

-press Ctrl-O, then enter to save. press Ctrl-X to get back to terminal.

-Turn off automatic time synchronization in OS X under system preferences. We can let windows do the sync'ing, or just manually sync every now and time.

That should be it. Hope it works for you!

#2
BJMoose

BJMoose

    InsanelyMac Legend

  • Donators
  • 1,154 posts
  • Gender:Male
  • Location:DE, USA
This problem was addressed by apple almost a year ago in one of the early generations of bootcamp. Just google for a file named appletime.exe (part of bootcamp) and place it in your windows startup folder. That's all there is too it. Times will be synched from now on.

#3
speedy859

speedy859

    InsanelyMac Protégé

  • Members
  • Pip
  • 9 posts
Oh haha...makes me feel kind of stupid

That's what i get for only checking in to the scene sporadically.

#4
Jadedknight

Jadedknight

    InsanelyMac Protégé

  • Members
  • PipPip
  • 76 posts
Thanks both of you for the info ;)

#5
pcuser32

pcuser32

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts
Great Post Thanks

#6
BigPimpin

BigPimpin

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 557 posts
  • Location:North Slope

Great Post Thanks


Better late than never.

#7
Ray2Jerry

Ray2Jerry

    InsanelyMac Protégé

  • Members
  • Pip
  • 10 posts
Hi,

I once found an easy installer by Zephyroth that fixed the time sync problem, but I can't seem to find that file anywhere anymore. It worked much better than Appletime.exe, in fact it fixed everything perfectly after installing, only I had to reinstall everything and lost it :P .

Anyone know where I can find this again?

Thanks!
rAy

UPDATE: Hey! I found it, and here it is for all of you :D It works awesome, and all you have to do is install it, no scripts, no start-up syncing programs. This file is legit, but if you don't trust me then just don't install it, and use at your own risk!

Attached Files



#8
tessa17

tessa17

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 120 posts
  • Gender:Female
  • Location:USA
Thanks for posting i was looking all over for this for days going crasy :wacko: and yes i agree it is awesome. :P :D

#9
intermatt

intermatt

    InsanelyMac Protégé

  • Members
  • Pip
  • 1 posts
I stumbled on this months ago and then had to use my hard drive to replace a dead one in a laptop. Long story short this saved me most of the hair on my head. Thanks for the post.

#10
Komano

Komano

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 175 posts
Just another mirror if you guys would like.

http://www.multiupload.com/K4CMSNZ034

#11
Gringo Vermelho

Gringo Vermelho

    The Jan Bird fix

  • Supervisors
  • 6,047 posts
  • Gender:Male
  • Location:Brazil
In my opinion, the best way to fix this issue is this:

Boot into Windows, run regedit, and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation (if the key isn't there, create it)

Add a DWORD "RealTimeIsUniversal" and set its value to 1

Reboot and adjust your time in Windows if it hasn't self-adjusted.

There is no need to do anything else, NTP time syncing will work fine, you can leave it on.

Your BIOS clock will be wrong from now on (leave it wrong) but there will no longer be any time difference between OS X and Windows.

Note that this only works 100% reliably with Windows 7, apparently there are issues when using it with Vista and XP, like wrong time when coming out of standby and other weird things that shouldn't be happening.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy