Set Time Zone

Luket
New Contributor

Anyone have a good way of setting the time zone up correctly?

I have tried using the time zone script on the jamf forums, however we are still seeing issues with the time being up to 5 minutes off. Is there a way to enable the automatically detect time zone setting while also enabling locations services to allow this to happen?

1 ACCEPTED SOLUTION

davidacland
Honored Contributor II

Not sure if it helps but we normally use:

/usr/sbin/systemsetup -settimezone "Europe/London"
/usr/sbin/systemsetup -setusingnetworktime on

View solution in original post

7 REPLIES 7

Look
Valued Contributor III

On 10.11 at least to manually set a time zone it's along the lines of.
systemsetup -listtimezones
systemsetup -settimezone Pacific/Auckland

Has worked for us, plus an ntp call to actually set the time after changing the time zone.

davidacland
Honored Contributor II

Not sure if it helps but we normally use:

/usr/sbin/systemsetup -settimezone "Europe/London"
/usr/sbin/systemsetup -setusingnetworktime on

For some time now the command

/usr/sbin/systemsetup -settimezone "Europe/London"

throws an error, any ideas on that?

 

systemsetup[2646:119258] ### Error:-99 File:/AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/Admin/InternetServices.m Line:379

 

 

systemsetup -settimezone Europe/Berlin

 

throws following error but nevertheless seems to set the timezone:

 

systemsetup[2799:138423] ### Error:-99 File:/AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/Admin/InternetServices.m Line:379
Set TimeZone: Europe/Berlin

 

Any ideas on how to get rid of the error?

sean
Valued Contributor

Is this what you require?

Jamf Post #6835

talkingmoose
Moderator
Moderator

If you're seeing a small drift of a few minutes, then the time zone setting is not your solution. That will only take care of setting your Mac to one of the 24 world time zones. You may not be connecting to your preferred NTP time server.

Have you verified your Macs are able to communicate with time.apple.com? Some networks may block access. If they're able to communicate then try "turning it off and on again" using a script. Something like:

systemsetup -setusingnetworktime off
systemsetup -setusingnetworktime on

I've found that works but may not reflect on the login window if no user is logged in. But once you log in, the clock appears correctly

JAMF Nation also has a time server script you may find useful.

https://jamfnation.jamfsoftware.com/viewProductFile.html?fid=854

jchurch
Contributor II

i also like to throw a manual update command at the bottom

update Time

/usr/sbin/ntpdate -u 10.x.x.x

or whatever the ipaddress of your time server is