steven1313 Posted November 18, 2008 Share Posted November 18, 2008 Hi, I'm trying to do the "Localtime instead of Universal for RTC" thats on the osx86 website, but having some difficulties... In Leopard, /etc/rc.local, /etc/rc.shutdown.local and StartupItems startup/shutdown mechanisms are deprecated. Instead, the following Leopard-friendly solution will 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. I have no idea what it means by "create new file" for 1 & 3.. Could someone please explain it better, in more detail? Sorry I'm a n00b when it comes to osx.. Thanks in advance! Link to comment https://www.insanelymac.com/forum/topic/137110-time-fix/ Share on other sites More sharing options...
MacUser2525 Posted November 18, 2008 Share Posted November 18, 2008 Hi, I'm trying to do the "Localtime instead of Universal for RTC" thats on the osx86 website, but having some difficulties... I have no idea what it means by "create new file" for 1 & 3.. Could someone please explain it better, in more detail? Sorry I'm a n00b when it comes to osx.. Thanks in advance! Open the terminal program (located in the Applications -> Utilities folder) then type in and hit enter key sudo -s then you need to put in the password you set on install. You now have root access to the machine thus can do anything you wish then in the same terminal use. nano /sbin/localtime-toggle Copy and paste the portion of your post which applies to this file into it then use the CTRL + O keys at the same time to write out the file you need to hit the ENTER key to confirm saving the file once done this then CTRL + X keys to exit. Do the make executable part then repeat the process of using nano for the second file and you should now have it working like it says when you reboot. Edit: The + in the CTRL + O , X mean both at the same time not the plus key on the keyboard. Link to comment https://www.insanelymac.com/forum/topic/137110-time-fix/#findComment-970409 Share on other sites More sharing options...
steven1313 Posted November 18, 2008 Author Share Posted November 18, 2008 Thanks!! Worked perfectly Link to comment https://www.insanelymac.com/forum/topic/137110-time-fix/#findComment-970518 Share on other sites More sharing options...
Danaan Posted October 14, 2009 Share Posted October 14, 2009 I am trying to do what you said, but for some reason the file doesn't get auto executed. My root user has a password set. Is there a way to modify the first file format (/sbin/localtime-toggle) so that it inputs the password? Cause when I try to run the file without being logged in on the (su -) terminal it says Permission denied. Link to comment https://www.insanelymac.com/forum/topic/137110-time-fix/#findComment-1298381 Share on other sites More sharing options...
srs5694 Posted October 14, 2009 Share Posted October 14, 2009 I recommend taking a different approach entirely: In Windows, follow these directions to have Windows interpret the hardware clock as being set to UTC, which is what OS X, Linux, FreeBSD, and (AFAIK) all other modern operating systems do. You'll then need to reset the hardware clock (but most OSes do this when they shut down normally). The advantage to this approach is that there's less chance of a mix-up around daylight saving time changes -- if I'm reading it correctly, the script presented in the first post will set the clock incorrectly if you boot OS X before you reset the hardware clock (manually or by having Windows do it) after a DST change. Link to comment https://www.insanelymac.com/forum/topic/137110-time-fix/#findComment-1298415 Share on other sites More sharing options...
Recommended Posts