Jump to content

Leopard 10.5.2 wrong time / wrong clock when switching back and forth from Vista (please help!)


15 posts in this topic

Recommended Posts

OK..........................

 

I want to use the first solution provided on the Wiki ('Tips And Tricks' section). However, I've never used Unix/Linux and I have NEVER used 'Terminal' under OS X before. Granted, I use Windows Vista, but even then, I rarely do anything with command lines.

 

I need to set Leopard 10.5.2 to use Local Time instead of Univeral Time. The only problem is that I can't find "rc.local" nor "rc.shutdown.local" anywhere on the hard drive. So here are my questions:

 

1) Where can I find those files!?

2) What is the proper way to edit them? (step-by-step, please)

3) If those files don't exist in Leopard in the first place, what is the proper STEP-BY-STEP way to create them?

4) I understand that these files were in Tiger, based on some previous postings in the Tiger 10.4.x section of the forum. If they were taken out in Leopard 10.5.x's release, is there any guarantee that creating these files will work at all?

5) Is there any circumstance or any way in which this solution would fail? (in other words, Leopard will somehow revert back to Universal time on its own, especially when I reboot into Vista and then go back into Leopard)

6) Judging from the filenames themselves ("rc.local" and "rc.shutdown.local"), does that imply that I need one for startup and rebooting as well? (ie. 'rc.startup.local' or 'rc.reboot.local')

 

You see? Unix commands are too vague and ambiguous for the average guy. But I'm willing to learn as I go. Right now, I need this... so please, if anyone can offer help I'll gladly appreciate it!

 

 

By the way, this is the 'solution' i'm referring to....

 

 

Use this little trick to change the clock between local & universal every boot. A couple lines need to be added to the initialization sequence, you'll need root privleges to do this. These files probably don't already exist on your system, so take that under advisement.

 

First you'll need to add a line to /etc/rc.local:

 

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

Note the use of backticks to tell sh to pass the output from the enclosed command to the outer one.

 

 

And to /etc/rc.shutdown.local you'll need to add this:

 

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

This changes it back again.

 

Be sure your clock is set correctly before your next reboot. Otherwise your clock will be messed up till you correct the time (either on macos or windows). This should keep your windows and macosx clocks in sync from now on.

Link to comment
Share on other sites

The simplest way to do this is have OSX automatically update the time every time you log on (checked off by default), then unzip this file in the startup folder in Windows so that it automatically adjusts the time. The problem occurs because Windows uses local time and Leopard uses GMT.

 

If I recall, this is the same file used with Boot Camp for real macs since they suffer the same problem.

AppleTime.zip

Link to comment
Share on other sites

Why don't you just install a client for ntp on Windows Vista?

Makes things a lot easier by adjusting the time automatically for you right after your network on vista starts.

 

/Cathul

 

Thanks Cathul, but unfortunately, I'm a bit paranoid about stuff running in the background, especially in Windows.

 

 

The simplest way to do this is have OSX automatically update the time every time you log on (checked off by default), then unzip this file in the startup folder in Windows so that it automatically adjusts the time. The problem occurs because Windows uses local time and Leopard uses GMT.

 

If I recall, this is the same file used with Boot Camp for real macs since they suffer the same problem.

 

Yes, Yuusharo. I am already aware of how both OSes tell time, and I really want Leopard to use 'Local Time' as explained in the Wiki. Also, the tool you provided, which is actually included with BootCamp does not work all the time, according to some posts in this forum.

 

 

I'm sorry komeet, but I should've emphasized early in my original post that everything in that thread is intended for -Tiger 10.4.x only-........ not Leopard 10.5.x. I'm asking how to do fix the problem for Leopard. Not Tiger. Not Vista.

 

what I did is adjust the time zone of the Mac relative to the local time to Windows.

 

By that, there is no problem.. Time is synch.

 

 

Thank you jed717ph, but I am rather tired of having to go into the System Preferences every time just to adjust the time. I would rather prefer to set Leopard to use Local Time and not UTC.

 

Speaking of which, if anyone has been able to fix this problem in Leopard using the -FIRST- suggestion provided on the Wiki page, please share the solution with us!!

Link to comment
Share on other sites

Windows xp/vista is the only OS that uses local time and every other real OS uses UTC. So stop trying to "fix" Leopard and give windows a kick. Use Yuusharo's appletime.exe above and put it in the startup folder in windows, so that it gets executed every time windows boots. This will keep your CMOS clock in UTC and both Windows and Leopard time will work correctly

Link to comment
Share on other sites

The stupid thing is both OS's of course "supposedly" support getting their time from a time server. Seeing as I have my time set for my time zone, it should just fix itself on boot. At least in my case Windows *never* does this until I open the time properties and remind it. OS X usually corrects the time, but I have had to nudge it a couple of times.

Link to comment
Share on other sites

I'm sorry komeet, but I should've emphasized early in my original post that everything in that thread is intended for -Tiger 10.4.x only-........ not Leopard 10.5.x. I'm asking how to do fix the problem for Leopard. Not Tiger. Not Vista.

 

Hmm... It works for me with 10.5.2, Vista and XP. And by the way what difference does it make if you have Tiger or Leo if you change a registry key in Windows?

Link to comment
Share on other sites

  • 2 weeks later...

I've got a similar problem/complaint. I can't find /etc/rc in 10.5 (Leopard)! So /etc/rc.local doesn't run. The question I have is precisely what is the boot sequence for Mac OS 10.5?

 

I thought at first it may have been transitioned to /Library/StartupItems or /System/Library/StartupItems but I don't see it. Has it been transitioned to elsewhere (ie like netinfo has been moved to Directory Services) into some XML or SQLite (like Solaris 10)?

Link to comment
Share on other sites

I experienced the same problem in Leopard with /etc/rc.local and /etc/rc.shutdown.local being ignored. Studying the Leopard documentation reveals that both /etc/rc* and StartupItems startup/shutdown mechanisms are deprecated. Consequently, I devised the following Leopard-friendly solution to toggle the clock between local time and UTC at start-up and shut-down times. You will need Administrator privileges when performing this procedure.

  1. Create new file /sbin/localtime-toggle with the following contents:
    #!/bin/sh
    
    to_utc() {
    echo "localtime-toggle: Toggling to UTC."
    date `date -u +%m%d%H%M%Y`
    }
    
    to_localtime() {
    echo "localtime-toggle: Toggling to localtime."
    date -u `date +%m%d%H%M%Y`
    }
    
    trap 'to_localtime; exit' term
    to_utc
    { while true; do sleep 86400; done; } &
    wait


     

  2. Ensure that localtime-toggle is executable:
    chmod +x /sbin/localtime-toggle


     

  3. Create new file /System/Library/LaunchDaemons/org.osx86.localtime-toggle.plist with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.osx86.localtime-toggle</string>
    <key>Program</key>
    <string>/sbin/localtime-toggle</string>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>HopefullyExitsFirst</key>
    <true/>
    </dict>
    </plist>


     

  4. Reboot.

At this point, your computer's clock should correctly be set to UTC as Leopard boots, and reset back to local time as Leopard shuts down.

Link to comment
Share on other sites

  • 1 month later...
I experienced the same problem in Leopard with /etc/rc.local and /etc/rc.shutdown.local being ignored. Studying the Leopard documentation reveals that both /etc/rc* and StartupItems startup/shutdown mechanisms are deprecated. Consequently, I devised the following Leopard-friendly solution to toggle the clock between local time and UTC at start-up and shut-down times. You will need Administrator privileges when performing this procedure.
  1. Create new file /sbin/localtime-toggle with the following contents:
    #!/bin/sh
    
    to_utc() {
    echo "localtime-toggle: Toggling to UTC."
    date `date -u +%m%d%H%M%Y`
    }
    
    to_localtime() {
    echo "localtime-toggle: Toggling to localtime."
    date -u `date +%m%d%H%M%Y`
    }
    
    trap 'to_localtime; exit' term
    to_utc
    { while true; do sleep 86400; done; } &
    wait


     

  2. Ensure that localtime-toggle is executable:
    chmod +x /sbin/localtime-toggle


     

  3. Create new file /System/Library/LaunchDaemons/org.osx86.localtime-toggle.plist with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.osx86.localtime-toggle</string>
    <key>Program</key>
    <string>/sbin/localtime-toggle</string>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>HopefullyExitsFirst</key>
    <true/>
    </dict>
    </plist>


     

  4. Reboot.

At this point, your computer's clock should correctly be set to UTC as Leopard boots, and reset back to local time as Leopard shuts down.

 

 

How do I make this run as admin? It works if I do it manually using sudo but gives a privileges error otherwise.

 

Please help!

Link to comment
Share on other sites

How do I make this run as admin? It works if I do it manually using sudo but gives a privileges error otherwise.

 

These files are all created in system areas and invoked by the system at boot time, so it should all be running as administrator automatically. It is not clear, therefore, what the exact problem is which you are experiencing. Perhaps you can provide more information about what steps you have taken and what exactly is going wrong.

Link to comment
Share on other sites

  • 2 months later...

I am running vista and kalyway 10.5.2. I have appletime running on vista. Appletime seems to only work right after I have been in OS X and updated my clock. If I boot several times into only vista my OS X and vista clock will be off. What is wrong?

Link to comment
Share on other sites

I am running vista and kalyway 10.5.2. I have appletime running on vista. Appletime seems to only work right after I have been in OS X and updated my clock. If I boot several times into only vista my OS X and vista clock will be off. What is wrong?

 

That depends upon how AppleTime.exe goes about its task. If it merely asks Windows to perform a time-sync, then all should be well regardless of how many times you boot consecutively into Windows. If, on the other hand, AppleTime.exe just adds or subtracts a fixed amount of time (your timezone difference) from the clock each time it is run, then your clock will skew on each consecutive boot of Vista.

 

Note that the Leopard-based solutions, such as the ones in this thread, are robust against skew since they change the hardware clock to GMT/UTC when Leopard is started, and then restore the hardware clock to your local timezone when Leopard exits. In this fashion, Leopard's GMT/UTC requirements are self-contained and transparent to Windows or any other operating system. Since a Leopard-based solution is self-contained, it should be used solely (without AppleTime.exe on the Vista side).

Link to comment
Share on other sites

 Share

×
×
  • Create New...