View Full Version : Date and time in the menu bar
MrSmith
Feb 15, 2006, 06:49 PM
In MacAddict this month there are instructions for putting the date with the time in the menu bar (10.3 & 10.4). I thought I'd share it with you all as it seems to be a point of annoyance to most people. This is the first time I've ever opened Terminal, but I can tell you there's nothing to be afraid of :)
Open Terminal (Applications>Utilities>Terminal). Cut and paste the line below at the prompt:
defaults write -g AppleICUTimeFormatStrings -dict-add 2 "MMMM d, hh':'mm':'ss' 'a"
Press Return
Then copy and paste this line:
killall SystemUIServer
Press Return again, then click anywhere on the screen to reload the menu bar.
To return it to the default, repeat with:
defaults write -g AppleICUTimeFormatStrings -dict-add 2 "hh':'mm':'ss' 'a"
Return
killall SystemUIServer
TrumanApple
Feb 15, 2006, 07:35 PM
Good work...
Doctor Q
Feb 15, 2006, 08:26 PM
I wonder what the single quote marks are for. They seem to enclose the colons and one space, but not the comma and the other two spaces.
faintember
Feb 15, 2006, 09:06 PM
Very nice..i just wonder if there is a way for it to display 9:00 instead of 09:00 for the hour..
Doctor Q
Feb 15, 2006, 09:17 PM
Very nice..i just wonder if there is a way for it to display 9:00 instead of 09:00 for the hour..Try a single h instead of hh and see if that works.
Sogo
Feb 15, 2006, 09:23 PM
You know, there was a way to change it in the system prefrences in 10.4. But it was somewhat convoluted...I actually wanted to change it to something else but i couldnt remember exactly how to do it.
Anywho, how do i get it to say Nov instead of the whole word?
faintember
Feb 15, 2006, 09:27 PM
Try a single h instead of hh and see if that works.
Duh, i took my idiot pills today. Thanks Doc Q.
mkrishnan
Feb 15, 2006, 09:30 PM
I don't get the command syntax exactly... why are you writing a certain date string to be hh:mm:ss, when the resulting clock doesn't show seconds, and does show the day and date? Hmmm... I'm confused about how to customize this, for instance, to have a short date, or a full day.
MrSmith
Feb 15, 2006, 09:34 PM
For completeness. In my case the ss is redundant because I've turned off 'Display the time with seconds' in System Prefs>Date & Time.
mkrishnan
Feb 15, 2006, 09:39 PM
So the "-dict-add 2" part causes you to add another dictionary entry to the key, right? But I don't see that any part of the key actually addresses the day / date format. Which is what really has me confused. :(
Doctor Q
Feb 15, 2006, 09:47 PM
I'll take another guess, that MMMM gets you "February" and MMM gets you "Feb" (the three letter abbreviation).
Stinkythe1
Feb 15, 2006, 09:49 PM
WOW! This is awesome. I have been wanting the clock to do this forever! But I could never find the option to do this.
Thanks so much!
Sogo
Feb 15, 2006, 10:11 PM
I'll take another guess, that MMMM gets you "February" and MMM gets you "Feb" (the three letter abbreviation).
I wanted to guess that, but then i just asked myself "what if i put 'MM' or maybe 'M'...will i break it?"
tag
Feb 15, 2006, 10:22 PM
Thats neat I had no idea you could do it from the command line like that, you could easily add any characters you want that way as well. I saw something like this a while back, but instead the way I read posted was through the 'International' panel in Preferences as shown by this tip here at macosxhints (http://www.macosxhints.com/article.php?story=20050508000838365).
You basically can goto 'Formats' under 'International Preferences' and customize the Full Dates section, and copy whatever you come up with there, and then repaste that into the Medium times section(which is the format the menu bar uses to represent the date/time layout). I made it sound confusing I'm sure but the link explains it way better than me. Basically it does the exact same thing, just without using the terminal, though I love the terminal more, just thought I'd throw out this just in case.
jsw
Feb 15, 2006, 10:42 PM
FWIW, MenuCalendarClock (http://www.objectpark.net/mcc.html) adds some nice capabilities to showing date and time, and most of the functions are in the free version.
Not as cool as a Terminal hack, but a nice little menulet.
wickedG35
Feb 15, 2006, 10:43 PM
Duh, i took my idiot pills today. Thanks Doc Q.
If you change the hh to a single h, what happens when the time reach 10:00? Need to recheck this...
faintember
Feb 15, 2006, 10:44 PM
^^^^^^It is fine....it is currently displaying 10:44 with one "h" rather than the two "h"'s.
theBB
Feb 15, 2006, 11:04 PM
T... through the 'International' panel in Preferences as shown by this tip here at macosxhints (http://www.macosxhints.com/article.php?story=20050508000838365).
Well, there are more than a few posts on that page where users had problems with iCal when they modify the menu bar clock format through terminal or "international preferences" panel. You might want to check.
tag
Feb 15, 2006, 11:18 PM
Well, there are more than a few posts on that page where users had problems with iCal when they modify the menu bar clock format through terminal or "international preferences" panel. You might want to check.
Yeah I do remember reading about some oddities that happened though I never use iCal so I don't really care if it does mess it up or not. I haven't personally found anything that got messed up by it though personally.
I also found it affects other apps as well such as Adium which will display the timestamp in its logs in the same format as your menubar date/time. Which I personally think is kind of neat. Though it can be a bit of an eyesore if you have a huge date/time setup such as mine..
Adium Log snippet...
⦗Wed, Feb 15, 2006 ⦘∞⦗11:13:58 PM US/Eastern⦘ myusernamehere: hi hi
⦗Wed, Feb 15, 2006 ⦘∞⦗11:14:25 PM US/Eastern⦘ justafriend: heya
mduser63
Feb 15, 2006, 11:39 PM
Thats neat I had no idea you could do it from the command line like that, you could easily add any characters you want that way as well. I saw something like this a while back, but instead the way I read posted was through the 'International' panel in Preferences as shown by this tip here at macosxhints (http://www.macosxhints.com/article.php?story=20050508000838365).
You basically can goto 'Formats' under 'International Preferences' and customize the Full Dates section, and copy whatever you come up with there, and then repaste that into the Medium times section(which is the format the menu bar uses to represent the date/time layout). I made it sound confusing I'm sure but the link explains it way better than me. Basically it does the exact same thing, just without using the terminal, though I love the terminal more, just thought I'd throw out this just in case.
I used this method, and my clock says (right now) "Wed Feb 15 - 9:38 PM". It's very customizable which is nice.
MrSmith
Feb 15, 2006, 11:54 PM
I changed to this:
defaults write -g AppleICUTimeFormatStrings -dict-add 2 ".. MMM d .. h':'mm':'ss' 'a"
iPhil
Feb 16, 2006, 12:09 AM
I changed to this:
defaults write -g AppleICUTimeFormatStrings -dict-add 2 ".. MMM d .. h':'mm':'ss' 'a"
which gives this (easier to see):
http://www.v-gr.com/menubar2.png
Do i copy the whole 'default' line into terminal??:confused: :confused:
its my first time using terminal for me.. :o :o
I don't wanna screw up my system when entering the command :o
faintember
Feb 16, 2006, 12:11 AM
Do i copy the whole 'default' line into terminal??:confused: :confused:Yes
Or do it the non-Terminal way mentioned above by using the System Preferences>International thingy. That way you can feel more comfortable with the interface and customize it how you want it.
MrSmith
Feb 16, 2006, 12:13 AM
Yes, all of it.
Then press Return
Then copy and paste the second line (killall...)
Then press return again.
Then just click on the desktop anywhere
iPhil
Feb 16, 2006, 12:44 AM
Thanks, for the information on what to paste into terminal :o :o
I like the extended date/time (wed..feb15..9.37pm) because @least once a day i'm asked month/day is.. For me its easier for me to read it :o :o
The system pref. way to change the date/time didn't work fully for me :(
Thats why i did the terminal way
edit: the time is shown was the time i was done with terminal tweak
I'm not a UNIX GEEK yet .. im still a noob in unix but learning
spinne1
Feb 23, 2006, 12:21 AM
Following the links in this thread eventually led me to wClock:
http://www.wolfware.com/software.html
This app does all that the Terminal hack does except much more. It is donationware. I really like it.
MrSmith
Feb 23, 2006, 05:40 AM
I tried that and took it off again. I forget the problem. I think it disappeared when I shut down, or something.
funkychunkz
Feb 23, 2006, 06:10 PM
To change it to 09:00, type 'defaults write apple.com.menuclock display style;{we are in the military}
:D
No, seriously, just go to the date&time panel, under clock.
Aarow
Feb 23, 2006, 06:37 PM
I followed this tutorial a few months ago, it does pretty much the same thing.
Might be easier for those who go :eek: in Terminal.
http://creativebits.org/mac_os_x/date_and_time_in_the_menubar
e: Durr, I didn't read through the posts, just the original :o.
Apple
Feb 23, 2006, 07:02 PM
You know you can just click on the time and a window will come up showing all the info
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.