views:

43

answers:

2

I need to set the date and time on my Mac (Intel, Snow Leopard) to a specific date and time each time it boots. Does anyone know how I can accomplish this using AppleScript or something else?

+2  A: 

This page has information on how to run a script automatically at boot time.
The Unix date command (docs) should allow you to change the date and time when run as root.

You may also need to disable the ntpd program, as that tries to keep the date and time in sync automatically by querying time-servers on the Internet. ntpd is started by the launchd process (docs). The file that starts ntpd is in /System/Library/LaunchDaemons/org.ntp.ntpd.plist.

Pat Wallace
+2  A: 

Use Applescript to run a shell script; save the script as an App and run it from your Login Items pane in System Preferences/Accounts:

do shell script "/usr/sbin/systemsetup -setdate 'mm:dd:yy' -settime 'hh:mm:ss'"

Or save the script as a .sh script and run it on startup with launchd: System Startup Programming Topics: Creating a Startup Item

songdogtech