Are you prepared for Wrath of the Lich King? WoW Insider has you covered!

TUAW Tip: Setting your clock automatically after using Boot Camp

I use Boot Camp pretty regularly, and one thing that always annoyed me about booting back into the world of the living the Mac was that my clock was always eight hours behind (I live in the Pacific time zone). Windows likes to set the system clock to my local time of GMT –8. Mac OS X, on the other hand, likes to keep the hardware clock at GMT, and set it "softly" using the operating system software. There are some hairy registry fixes for the Windows behavior, but they're unsupported.

While manually setting my clock back for the eleventy billionth time, I noticed that just opening and closing the Date & Time preference pane sets the clock automatically. Of course, I had to be connected to the Internet, and have the "set date & time automatically" checkbox selected.

Sensing an opportunity to make my life easier, I wrote myself an AppleScript that simply opens the Date & Time preference pane, leaves it open for a few seconds, and then closes it. I saved it as an application, and set it to run at startup.

That way, by the time my computer is finished booting, the clock is right, and I didn't have to even think about it.

After the jump, some code and instructions on how to do this yourself.

Here's how you can create a helper app like this to set your clock automatically every time your computer boots.

  1. From the Apple menu, choose System Preferences.
  2. Click Date & Time.
  3. Make sure the Set date & time automatically box is checked.
  4. Start Script Editor (which is usually located in the AppleScript folder in your Applications folder).
  5. From the File menu, choose New.
  6. Type or paste the following code:
    tell application "System Preferences"
    reveal pane "Date & Time"
    delay 5
    quit
    end tell
  7. Click Compile in the toolbar to make sure there are no problems with your code.
  8. You can try it out live by clicking Run, too.
  9. Back in Script Editor, choose Save As ... from the File menu.
  10. Enter a name like Set Clock Automatically.
  11. Choose a location to save the app. (I put mine in the Utilities folder inside my Applications folder.)
  12. From the File Format drop-down, select Application.
  13. Click Save.
  14. You can quit Script Editor, if you want.
  15. From the Apple menu, choose System Preferences.
  16. Click Show All, then click Accounts.
  17. In the left pane, click the name that corresponds to your user account.
  18. Click the Login Items tab.
  19. Click the + button below the list of applications.
  20. Find and select the application you saved in steps 6-10.
  21. Click Add.
  22. You can quit System Preferences, if you want.

As a wise author once said, "do these steps, and then you're done." Make sure you're connected to the Internet, and then give it a try by restarting into Windows, and restarting back into Mac OS X.

I've been using this script with Mac OS X 10.4 "Tiger" and 10.5 "Leopard," and have had no problems.

Related Headlines

Reader Comments (Page 1 of 2)

Add your comments

Please keep your comments relevant to this blog entry. Email addresses are never displayed, but they are required to confirm your comments.

When you enter your name and email address, you'll be sent a link to confirm your comment, and a password. To leave another comment, just use that password.

To create a live link, simply type the URL (including http://) or email address and we will make it a live link for you. You can put up to 3 URLs in your comments. Line breaks and paragraphs are automatically converted — no need to use <p> or <br /> tags.

TUAW Features

back-to-school
Mac 101 ask-tuaw
Mac News
WWDC (251)
.Mac (65)
Accessories (651)
Airport (75)
Analysis / Opinion (1402)
Apple (1695)
Apple Corporate (573)
Apple Financial (197)
Apple History (51)
Apple Professional (54)
Apple TV (164)
Audio (450)
Bad Apple (130)
Beta Beat (155)
Blogging (87)
Bluetooth (18)
Bugs/Recalls (56)
Cult of Mac (879)
Deals (224)
Desktops (116)
Developer (277)
Education (109)
eMac (10)
Enterprise (146)
Features (411)
Freeware (397)
Gaming (390)
Graphic Design (37)
Hardware (1302)
Holidays (37)
Humor (586)
iBook (66)
iLife (240)
iMac (185)
Internet (339)
Internet Tools (1337)
iTS (981)
iTunes (823)
iWork (23)
Leopard (375)
Mac mini (112)
Mac Pro (54)
MacBook (206)
MacBook Air (82)
Macbook Pro (225)
MobileMe (47)
Multimedia (457)
Odds and ends (1481)
Open Source (281)
OS (937)
Peripherals (214)
Podcasting (183)
Podcasts (94)
Portables (198)
PowerBook (136)
PowerMac G5 (51)
Retail (610)
Retro Mac (50)
Rig of the Week (42)
Rumors (640)
Software (4442)
Software Update (425)
Steve Jobs (254)
Stocking Stuffers (50)
Surveys and Polls (97)
Switchers (114)
The Woz (35)
TUAW Business (256)
Universal Binary (281)
UNIX / BSD (61)
Video (907)
Weekend Review (84)
WIN Business (47)
Wireless (87)
Xserve (39)
iPhone/iPod News
iPhone (1755)
iPod Family (2109)
App Store (144)
SDK (27)
Mac Events
One More Thing (27)
Liveblog (2)
Other Events (226)
Macworld (489)
Mac Learning
AppleScript (4)
Ask TUAW (106)
Blogs (85)
Books (26)
Books and Blogs (62)
Cool tools (449)
Hacks (471)
How-tos (490)
Interviews (44)
Mods (190)
Productivity (591)
Reviews (114)
Security (166)
Terminal Tips (64)
Tips and tricks (574)
Troubleshooting (171)
TUAW Features
iPhone 101 (36)
TUAW Labs (4)
Blast From the Past (19)
TUAW Tips (150)
Flickr Find (38)
Found Footage (90)
Mac 101 (109)
TUAW Interview (31)
Widget Watch (198)
The Daily Best (1)
TUAW Faceoff (6)

RESOURCES

RSS NEWSFEEDS

Powered by Blogsmith

Sponsored Links

The Unofficial Apple Weblog (TUAW) bloggers (30 days)

#BloggerPostsCmts
1Robert Palmer4942
2Cory Bohon461
3Steven Sande3913
4Erica Sadun251
5Scott McNulty242
6Mike Schramm230
7Giles Turnbull220
8Michael Rose2125
9Mat Lu1910
10Christina Warren1735
11Dave Caolo170
12Brett Terpstra110
13TUAW Blogger60
14Victor Agreda, Jr.26
15Jason Clarke11

Featured Galleries

Macworld 2008 Keynote
Macworld 2008 Build-up
Apple Vanity Plates
DiscPainter
Crash Bandicoot Nitro Kart 3D
Macworld Expo 2007 show floor
Apple Texas Hold 'Em
The Macworld Faithful in Line
iPhone First Look

 

    Most Commented On (7 days)

    Recent Comments

    More Apple Analysis

    More from AOL Money and Finance

    Other Weblogs Inc. Network blogs you might be interested in: