Change the clock format?

mconners
Valued Contributor

Hello Everyone,

I know there is a feature request out there for changing the clock format, but it is an older request. Has anyone found a workaround for this so we can display the clock in the menu bar with the seconds?

A simple function but it at least shows a little bit to the user that the system is still functioning in the background even if a foreground process is locked. Sometimes users aren't too keen about waiting and get anxious to force a restart. This little visual component helps in keeping users from pulling the plug too quickly.

Thanks!

9 REPLIES 9

andrew_nicholas
Valued Contributor

You should be able to edit this plist here /Users/[USERNAME]/Library/Preferences/com.apple.menuextra.clock. I set mine as

/Users/[USERNAME]/Library/Preferences/com.apple.menuextra.clock  DateFormat -string "EEE MMM d h:mm a"

Not sure what the seconds indicator is, though I imagine it will be h:mm:ss or something similar. You should be able to get the flags necessary from an existing appropriately configured machine.

Edit. It does indeed appear to be "ss".

bainter
Contributor

@mconners This should do it:

12-hour format with the (day of the) month and seconds:
defaults write com.apple.menuextra.clock "DateFormat" 'EEE d MMM hh:mm:ss'

Standard default time:
defaults write com.apple.menuextra.clock "DateFormat" 'EEE hh:mm a'

24 hours format with the (day of the) month and seconds:
defaults write com.apple.menuextra.clock "DateFormat" 'EEE d MMM HH:mm:ss'

bainter
Contributor

Forgot, to see changes:

Refresh the menu bar using:

killall -KILL SystemUIServer

Works in 10.12.4 Sierra.

mconners
Valued Contributor

Thank you for quick replies, this is very helpful.

cindySingh
New Contributor III

Hi @mconners Doesn't default option in System Pref has this? Do you mean, you dont want this AM/PM and only time to be hh:mm:ss ?

Smiles!
Cin

mconners
Valued Contributor

You are correct @cindySingh, System Prefs does have this, but the default is for hour and minute and not the seconds. My main goal was to preset this for the users that login so they aren't hunting for the setting and so that each user has the same setting.

a_holley
Contributor

@bainter 's commands worked in 10.12, but I am having trouble getting it to work in 10.13. Has anyone had any luck? What seems to have changed?

jack_hollister
New Contributor

Has anyone else found a alternative or updated syntax that works for High Sierra? We're currently trying to implement High Sierra into our DEP process to mirror that of Sierra but this is one of the last few 'User Experience' bits that does not work the same.

hepcat72
New Contributor

I'm actually here because I'm trying to find a work-around for a restricted jamf setting at my university that disallows me from enabling fast user switching. Since my username is not the same on every computer, I rely on the convenience of the username being displayed in the menu bar and a thought occurred to me that I could just add my username to the clock format string, but it doesn't seem to work. Is there a way to add any text to the format string?