How to initiate NTP update

2

0

My MBP currently is not connected to the internet when it is booted. (vacation)

now I notice, that each time I return to OS X after a Bootcamped XP game, my system time is of by an hour. (XP and OS X seem to have a different opinion if the HWclock should run UTC or local time, and no, I don't intend to fight that)

How (bash or apple-script) can I tell my Mac to go fetch the correct time via ntp once it connects to the internet?

I know how to do it using the GUI (and I'd rather not ..)

lexu

Posted 2010-02-13T11:07:18.277

Reputation: 1 822

2I know it looks cliché, but when the topic it's about time, it only concern swiss people (You, Studer and myself) – Kami – 2010-02-13T19:51:46.543

what can I say ... guilty as charged! :-) – lexu – 2010-02-13T22:07:00.453

Answers

1

I was experiencing the same problem ! I think, I have a better solution :

From my point of view it's better to tell WinXp to use the same time as Mac OS x (UTC) !

To do so, edit the following in the WinXP registry :

HKEY_LOCAL_MACHINE
 SYSTEM
  CurrentControlSet
   Control
    TimeZoneInformation
     RealTimeIsUniversal

and set it to a DValue of 1.

Kami

Posted 2010-02-13T11:07:18.277

Reputation: 3 108

I didn't know XP could do that .. thought it was one of those cultural difference between XP and OS X. THX! – lexu – 2010-02-13T15:32:29.337

2

Kami is right, but if you only want to force a ntp update, use the following :

sudo ntpdate 0.ch.pool.ntp.org

You can, of course, change the time server !

Studer

Posted 2010-02-13T11:07:18.277

Reputation: 3 448

+1 I was indeed looking for the kind of command you supplied .. but since Kami removed the need to take that route by showing me how XP can be told to cooperate, I intend to accept his answer. merci einewäg! – lexu – 2010-02-13T19:33:16.747