Posted on 04-20-2017 11:31 AM
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!
Posted on 04-20-2017 12:24 PM
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".
Posted on 04-20-2017 12:48 PM
@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'
Posted on 04-20-2017 12:53 PM
Forgot, to see changes:
Refresh the menu bar using:
killall -KILL SystemUIServer
Works in 10.12.4 Sierra.
Posted on 04-20-2017 01:08 PM
Thank you for quick replies, this is very helpful.
Posted on 04-20-2017 01:22 PM
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
Posted on 04-20-2017 02:24 PM
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.
Posted on 01-09-2018 04:57 PM
@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?
Posted on 02-07-2018 09:30 AM
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.
Posted on 06-09-2020 01:00 PM
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?