24 hour clock setting

skeb1ns
Contributor

Hi,

What is the best way to script the the 24 hour clock setting across the entire OS instead of the default 12 hour setting?

I already use the terminal commando /usr/sbin/systemsetup -settimezone "Europe/Amsterdam" -setnetworktimeserver "time.euro.apple.com" -setusingnetworktime on to set the correct timezone/server but this doesn't adjust the display of the clock itself.

Searching through google didn't provide me with an answer. The only topic that i've found (http://apple.stackexchange.com/questions/75116/i-want-to-change-clock-from-12h-to-24h-mode-via-terminal) pointed me to a plist that doesn't seem to exist in Yosemite.

Thanks in advance!

1 REPLY 1

jonod2977
New Contributor

Hey,

Try

/usr/bin/defaults write com.apple.menuextra.clock 'DateFormat' -string 'EEE MMM d H:mm'

then

/usr/bin/Killall SystemUIServer

If you are going to push it out via casper then you will have to do a script something like this as its a user level preference:

!/bin/sh

currentuser=/usr/bin/stat -f%Su /dev/console

/usr/bin/defaults write /Users/$currentuser/Library/Preferences/com.apple.menuextra.clock 'DateFormat' -string 'EEE MMM d h:mm'

/usr/bin/Killall SystemUIServer