Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrSmith

macrumors 68040
Original poster
Nov 27, 2003
3,046
14
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
 
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.
 
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?
 
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.
 
For completeness. In my case the ss is redundant because I've turned off 'Display the time with seconds' in System Prefs>Date & Time.
 
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. :(
 
I'll take another guess, that MMMM gets you "February" and MMM gets you "Feb" (the three letter abbreviation).
 
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!
 
Doctor Q said:
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?"
 
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.

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.
 

Attachments

  • menutimetag.jpg
    menutimetag.jpg
    19.4 KB · Views: 153
FWIW, MenuCalendarClock 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.
 
tag said:
T... through the 'International' panel in Preferences as shown by this tip here at macosxhints.
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.
 
theBB said:
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...
Code:
⦗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
 
tag said:
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.

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.
 
I changed to this:

defaults write -g AppleICUTimeFormatStrings -dict-add 2 ".. MMM d .. h':'mm':'ss' 'a"
 
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
 
Thanks, for the information on what to paste into terminal :eek: :eek:


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 :eek: :eek:

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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.