Date and time in the menu bar

Discussion in 'macOS' started by MrSmith, Feb 15, 2006.

  1. MrSmith macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #1
    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
     
  2. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #3
    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.
     
  3. faintember macrumors 65816

    faintember

    Joined:
    Jun 6, 2005
    Location:
    the ruins of the Cherokee nation
    #4
    Very nice..i just wonder if there is a way for it to display 9:00 instead of 09:00 for the hour..
     
  4. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #5
    Try a single h instead of hh and see if that works.
     
  5. Sogo macrumors 6502

    Joined:
    Jan 4, 2004
    #6
    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?
     
  6. faintember macrumors 65816

    faintember

    Joined:
    Jun 6, 2005
    Location:
    the ruins of the Cherokee nation
    #7
    Duh, i took my idiot pills today. Thanks Doc Q.
     
  7. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #8
    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.
     
  8. MrSmith thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #9
    For completeness. In my case the ss is redundant because I've turned off 'Display the time with seconds' in System Prefs>Date & Time.
     
  9. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #10
    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. :(
     
  10. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #11
    I'll take another guess, that MMMM gets you "February" and MMM gets you "Feb" (the three letter abbreviation).
     
  11. Stinkythe1 macrumors regular

    Joined:
    Mar 30, 2005
    #12
    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!
     
  12. Sogo macrumors 6502

    Joined:
    Jan 4, 2004
    #13
    I wanted to guess that, but then i just asked myself "what if i put 'MM' or maybe 'M'...will i break it?"
     
  13. tag macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #14
    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.
     

    Attached Files:

  14. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #15
    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.
     
  15. chosenwolf macrumors 6502a

    chosenwolf

    Joined:
    Feb 4, 2006
    Location:
    Los Angeles
    #16
    If you change the hh to a single h, what happens when the time reach 10:00? Need to recheck this...
     
  16. faintember macrumors 65816

    faintember

    Joined:
    Jun 6, 2005
    Location:
    the ruins of the Cherokee nation
    #17
    ^^^^^^It is fine....it is currently displaying 10:44 with one "h" rather than the two "h"'s.
     
  17. theBB macrumors 68020

    theBB

    Joined:
    Jan 3, 2006
    #18
    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.
     
  18. tag macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #19
    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
     
  19. mduser63 macrumors 68040

    mduser63

    Joined:
    Nov 9, 2004
    Location:
    Salt Lake City, UT
    #20

    I used this method, and my clock says (right now) "Wed Feb 15 - 9:38 PM". It's very customizable which is nice.
     
  20. MrSmith thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #21
    I changed to this:

    defaults write -g AppleICUTimeFormatStrings -dict-add 2 ".. MMM d .. h':'mm':'ss' 'a"
     
  21. iPhil macrumors 68040

    iPhil

    #22

    Do i copy the whole 'default' line into terminal??:confused: :confused:


    its my first time using terminal for me.. :eek: :eek:

    I don't wanna screw up my system when entering the command :eek:
     
  22. faintember macrumors 65816

    faintember

    Joined:
    Jun 6, 2005
    Location:
    the ruins of the Cherokee nation
    #23
    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.
     
  23. MrSmith thread starter macrumors 68040

    MrSmith

    Joined:
    Nov 27, 2003
    #24
    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
     
  24. iPhil macrumors 68040

    iPhil

    #25
    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
     

Share This Page