Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Add the date to the menubar clock System
I found a way to add the date to the menubar clock in Panther. Open ~/Library -> Preferences -> .GlobalPreferences.plist in your favorite text editor. Look for the AppleICUTimeFormatStrings section. In my file, it looked like this:

<key>AppleICUTimeFormatStrings</key>
<dict>
 <key>1</key>
 <string>h':'mm' 'a</string>
 <key>2</key>
 <string>h':'mm':'ss' 'a</string>
 <key>3</key>
 <string>h':'mm':'ss' 'a z</string>
 <key>4</key>
 <string>h':'mm':'ss' 'a z</string>
I found that modifying the 2 string changed my menu bar clock -- your mileage may vary. I changed the code so it lookes like this:

<key>2</key>
<string>d' 'h':'mm':'ss' 'a</string>
Note that I added d' ' right after the tag. The d represents the date, while the two tick marks (which have a space between them) surround the separator. The result (robg adds: as seen on my screen):


I found that simply opening up the Date and Time Preference Pane will update the clock format, but you may need to disable/enable the clock to see the change. I only changed the 2 string. If this does not work for you, you may need to modify one of the other four keys or just modify all four. Note: making changes to the International formatting will overwrite your change.

[robg adds: I didn't have these keys in my preferences. A quick email exchange with jpkelly led to the solution -- open the International preference pane, click on Formats, and then click on Customize for the Times section. Don't change anything, just quit System Preferences. You should now be able to find the keys in your .GlobalPreferences file (in the Terminal, of course, as it's hidden in the Finder). This is probably the #1 most requested Panther hint that I've seen flow through my inbox ... thanks jpkelly!]
    •    
  • Currently 1.13 / 5
  You rated: 1 / 5 (8 votes cast)
 
[37,462 views]  

10.3: Add the date to the menubar clock | 51 comments | Create New Account
Click here to return to the '10.3: Add the date to the menubar clock' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Add the date to the menubar clock
Authored by: macbiff on Nov 20, '03 11:26:01AM

i changed my to d'/'M'/'y' to get display like Fri 21/11/2003 12:25AM

any idea what other formats possible?



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: Jay on Nov 20, '03 11:54:36AM

Fantastic! I've been waiting for this ever since I upgraded to Panther.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: cynikal on Nov 20, '03 01:44:31PM

Here's the ones I've found so far..

a = AM/PM
d = day of month
e = day of week #
h = hour (1-12)
m = minutes
s = seconds
z = time zone

D = 324 ??
E = day of week word
F = 3 ?
G = AD (vs BC?)
H = hour (0-23)
K = 1 ??
M = month (1-12)

There should be documentation somewhere about the specific function that handles the formating of time strings.

What i'm looking for is the word name of hte month like Nov for the 11th month, november.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: rkriesel on Nov 20, '03 01:48:40PM

MMM = Mon

for example, "Nov"



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: William McCallum on Nov 20, '03 11:39:00AM

I'd be careful with this. There was a similar hint for Jaguar a while ago <a href=http://www.macosxhints.com/article.php?story=20020907073047908> here </a> which had a bad sideffect in iPhoto. When you tried to edit dates of photos in iPhote it got confused about formats and assigned spurious dates (I think the input format appearing in the date box was the old one, but it was reading information typed in as if it were in the new format).



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: danb5 on Nov 20, '03 11:51:59AM

Be careful with this kind of modifications. Many programs (e.g. Watson) use the time and date formats to display, well, times and dates. If you change your time format to also show your date, then places where these programs expect to show a time will also show a date ... which will break things. You have been warned!



[ Reply to This | # ]
PTH clock is easier
Authored by: bakalite on Nov 20, '03 11:57:11AM

I use PTH clock and have had no problems in Jaguar or Panther. It allows me to display the date and time exactly the way I want it, short day name, full date, and time with seconds in case I need to time something. Highly recommended.

Five stars on version tracker, and it's free...

http://www.versiontracker.com/dyn/moreinfo/macosx/8366



[ Reply to This | # ]
PTH clock is easier
Authored by: feelphree on Nov 20, '03 12:16:26PM

I agree, I have been using PTH Clock for a few weeks with Panther and it seems to be working just as well as it did with Jaguar and it is much easier to modify and probably less prone to creating other problems. But definately this is good information to know, nothing wrong with more knowledge!

Bryan



[ Reply to This | # ]
PTH clock is easier
Authored by: corvus on Nov 20, '03 01:00:54PM

Looks like PTH clock is no longer available:

http://www.pth.com/PTHClock/



[ Reply to This | # ]
PTH clock is easier
Authored by: wils on Nov 20, '03 10:11:33PM

try this link:

http://allmacintosh.xs4all.nl/preview/204063.html



[ Reply to This | # ]
PTH clock is easier
Authored by: robg on Nov 20, '03 01:11:20PM

Might not be free much longer -- PTH's assets were acquired recently...

-rob.



[ Reply to This | # ]
PTH clock is easier
Authored by: aamann on Nov 20, '03 02:52:39PM
Quoting from the PTH FAQ (http://www.pth.com/PTHClock/faq.html):

Is PTHClock freeware?
Yes. PTHClock is free and will always be free. [...]

[ Reply to This | # ]
PTH clock is easier
Authored by: robg on Nov 20, '03 04:15:47PM

Me thinks that's a bit out of date. Their site (offline right now) has a blurb on the front about how anyone who has donated for their menubar widgets will soon be contacted by the new owners of the products about a special offer (free? reduced price?) on the new software package...

I anticipate seeing an "all in one" release that combines the PTH entities into one uber-panel, ala MenuMeters, where you can pick and choose which you wish to see ... probably shareware at $25 or something. But we should know fairly soon now...

-rob.



[ Reply to This | # ]
PTH clock is easier
Authored by: thunter913 on Nov 20, '03 06:49:38PM

Since PTHClock 2.3.2 has been removed I cannot try the product to see if it does what I want. Does PTHClock allow you to display it as an icon in the menu bar?

The default OS clock does essentially what I want except that when it is in the analog mode and I click on the icon only the date is shown.

Is there a hack to make the drop down menu display both the time and date?



[ Reply to This | # ]
PTH clock is easier
Authored by: g3ski on Feb 26, '04 02:55:23PM

As of feb 2004, it's still available (eventhough their assets were bought by You Software).

http://www.pth.com/index.html

http://www.pth.com/PTHClock/


---
"I want my two dollars!"



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: ploiku on Nov 20, '03 01:06:01PM

Why not just modify the setting in

/System/Library/CoreServices/Menu Extras/Clock.menu/Contents/Resources/English.lproj/Localizable.strings

(Change English.lproj to whatever your language is).

The strings file is even documented - and only used by the menu clock...



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: PigDawg on Nov 20, '03 01:29:06PM

Where can I find documentation on the strings file? It appears to be binary



[ Reply to This | # ]
Example please...
Authored by: acalado on Nov 20, '03 01:30:46PM

Could you please provide an example? That plist doesn't seem to use the same format as those in the hint.

Thanks,

Andy



[ Reply to This | # ]
Example please...
Authored by: corvus on Nov 20, '03 01:55:48PM

You can open it with Project Builder.



[ Reply to This | # ]
10.3: modifying Localizable.strings doesn't work
Authored by: ces3001 on Nov 20, '03 02:14:00PM

In any case, I couldn't get the changes to actually take effect, even after logging out/in. (And yes, I used sudo /Applications/TextEdit.app/Contents/Mac OS/TextEdit to open the file and edit it, all other apps, including my favorite, pico, wouldn't open it correctly).



[ Reply to This | # ]
10.3: modifying Localizable.strings doesn't work
Authored by: joshuajestelle on Nov 20, '03 02:48:39PM

It won't work for me either.

Has anyone gotten this to work? This seems like the best way to go about changing this, as it shouldn't cause problems for any other apps.

Thanks,
Jsoh



[ Reply to This | # ]
10.3: modifying Localizable.strings doesn't work
Authored by: scottmc on Dec 18, '03 05:00:35PM
I've been working on this, and had the most success by ftping Localizable.strings to a host running Solaris 8, where Sun's version of vi opened it cleanly. It does seem that this file has some funky characters in it at the top which seem to throw off editors on OSX. I also looked at it with bvi (Binary vi) and it looked the same.

I haven't had a change to muck with the settings yet. Hopefully I'll have more time to test mods to it tonight. Anyone have the list of string values that this file uses?

For those who haven't been able to view the file, here are the contents (without the nasty control characters).


Listing of Localizable.strings



/* View as Icon Menu String */
"MBC_VIEW_AS_ICON_MENUITEM" = "View as Analog";

/* View as Text Menu String */
"MBC_VIEW_AS_TEXT_MENUITEM" = "View as Digital";

/* View in Floating Window */
"MBC_VIEW_IN_WINDOW_DIGITAL" = "View in Window as Digital";

/* View in Floating Window */
"MBC_VIEW_IN_WINDOW_TRADITIONAL" = "View in Window as Analog";

/* Open Date & Time String */
"MBC_OPEN_DATETIME_MENUITEM" = "Open Date & Time &";

/* 1st menu item date/time format string */
/* NO LONGER USED.  The first menu item displayed now uses NSDateFormatString */
/*  it doesn't include the time, but it solves a lot of localization issues and works */
/*  around some Foundation / International prefs interaction issues */
/* "MBC_DATETIME_MENUITEM_FORMAT" = "%A %1m/%e/%Y %1I:%M%p"; */


/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/* The following 3 strings are used to set up the format the menu bar clock will use     */

/*  Localizations needs to follow these instructions for the menu clock to work properly. */

/*  MBC_CLOCK_FORMAT_STRING is the main format string.  It MUST contain a %a, %time, and %p */
/*      The order of the items can vary and any additional characters or punctuation is ok */
/*      For example, you could put the short day of week at the END of the menu bar clock by */
/*      changing the format to: "%time%p %a" */
//"MBC_CLOCK_FORMAT_STRING" = "%a %time%p";
"MBC_CLOCK_FORMAT_STRING" = "%a %time";


/* MBC_CLOCK_REMOVE_AMPM_STRING is a string that is used to REMOVE the AM/PM display when a user
 */
/*      turns off display AM/PM (or selects 24 hour formats).  This string MUST contain %p.  It 
should */
/*      also contain any additional characters that need to be removed when the AM/PM isn't bein
g */
/*      displayed.  For example, a format that wanted a dash to appear before the AM/PM would be
: */
/*      "%a %time-%p".  To remove it when a user turns off AM/PM display, the MBC_CLOCK_REMOVE_A
MPM_STRING */
/*      should contain "-%p" */
"MBC_CLOCK_REMOVE_AMPM_STRING" = " %p";


/* MBC_CLOCK_REMOVE_DAYOFWEEK_STRING is a string used to REMOVE the short day of week display when a user */
/*      turns off the show day of week option in the preferences.  This string MUST contain %a. It should */
/*      also contain any additional characters that need to be removed when the day of week isn't being */
/*      displayed.  For example, the US time format puts a space between the day of week and the start of */
/*      the time so MBC_CLOCK_REMOVE_DAYOFWEEK_STRING containds "%a " */
"MBC_CLOCK_REMOVE_DAYOFWEEK_STRING" = "%a ";

/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/


[ Reply to This | # ]
10.3: modifying Localizable.strings doesn't work
Authored by: msephton on Apr 12, '04 08:27:29AM

I'd also be interested in getting this to work. I'm reluctant to use third party clock apps just because they add extra bloat to a system. If we can tweak the OS to do it, surely that's better?



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: sfodden on Nov 20, '03 01:06:54PM

I use wClock, which works just fine in Panther.

http://www.wolfware.com/wclock/index.html


---
Simon F.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: Blah on Jan 11, '04 01:32:54PM

Well.... I loved what wClock seemed to provide, but it caused instability on my machine (Jaguar 10.2.6 and earlier 10.2.x). I tried to live with it for a few months, but eventually just deleted it.

The app itself would die after a random amount of time. Varied a lot, from as little as a day or two to many days, leaving me with no clock in the menubar at all. But I also had other apps crashing far more than normal as well, and when I removed wClock entirely those problems seemed to go away. No absolute repeatable facts, but was a strong enough correlation for me to want to post a 'be careful' warning here.

It's also possible that a new version has come out in the meantime - I haven't gone back to check after the problems I had, and this was several months ago (maybe as long as a year?)

On the machine that had problems I haven't replaced it with anything, just use the standard system clock, but on my iBook I've been using iClock for a few months and it's been providing a similar feature for me without any issues.

YVVM



[ Reply to This | # ]
wClock is another option
Authored by: mclbruce on Nov 20, '03 01:09:38PM

I use wClock in Panther.

http://www.wolfware.com/wclock/index.html

It seems to work fine. I have my version customized so the icon does not appear in the dock and so the pop up calendar is not metal. Hints can be found on this site to do both modifications.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: guybrush on Nov 20, '03 01:59:39PM

kinda funny, i posted the solution to customize the clock in panther in this thread: http://forums.macosxhints.com/showthread.php?s=&threadid=17117

even with a link to the IBM ICU formats.
i submitted the hint after somebody confirmed it worked, guess i was too late :(

would really hate if jpkelly read my thread and posted the hint without giving kudos to me :(



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: robg on Nov 20, '03 02:05:04PM

Sorry, that's one of the downsides to the submission queue -- I work in order of submission :). So yours is probably sitting in there somewhere ...

In the future, you can just drop me an email with a pointer and I can take quicker action that way!

cheers;
-rob.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: jpkelly on Nov 20, '03 10:01:48PM

Actually I discovered it on my own. Amazingly enough!



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: guybrush on Nov 20, '03 02:23:57PM

Just to make the hint more complete, for anyone that is searching for the available ICU formats:

http://oss.software.ibm.com/icu/apiref/classSimpleDateFormat.html (search for "format syntax")



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: cynikal on Nov 20, '03 03:57:05PM
Or we could just post em here:

    Symbol   Meaning                 Presentation       Example
    ------   -------                 ------------       -------
    G        era designator          (Text)             AD
    y        year                    (Number)           1996
    Y        year/week of year       (Number)           1996
    M        month in year           (Text & Number)    July & 07
    d        day in month            (Number)           10
    h        hour in am/pm (1~12)    (Number)           12
    H        hour in day (0~23)      (Number)           0
    m        minute in hour          (Number)           30
    s        second in minute        (Number)           55
    S        millisecond             (Number)           978
    E        day of week             (Text)             Tuesday
    e        day of week/local (1~7) (Number)           2
    D        day of year             (Number)           189
    F        day of week in month    (Number)           2 (2nd Wed in July)
    w        week in year            (Number)           27
    W        week in month           (Number)           2
    a        am/pm marker            (Text)             PM
    k        hour in day (1~24)      (Number)           24
    K        hour in am/pm (0~11)    (Number)           0
    z        time zone               (Text)             Pacific Standard Time
    '        escape for text
    ''       single quote                               '

The count of pattern letters determine the format.

(Text): 4 or more, use full form, (Number): the minimum number of digits. Shorter numbers are zero-padded to this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is handled specially; that is, if the count of 'y' is 2, the Year will be truncated to 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces "97".)

(Text & Number): 3 or over, use text, otherwise use number. (e.g., "M" produces "1", "MM" produces "01", "MMM" produces "Jan", and "MMMM" produces "January".)

[ Reply to This | # ]

10.3: Add the date to the menubar clock
Authored by: Fofer on Nov 20, '03 06:53:09PM

Let's not forget about iClock:
http://www.versiontracker.com/dyn/moreinfo/macosx/18285



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: ars on Nov 20, '03 10:35:06PM

Look also at wClock:
http://versiontracker.com/dyn/moreinfo/macosx/7766
It lets you pick the font/font size and has a convenient pop-up calendar



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: appleguru on Nov 20, '03 10:45:46PM

My current favorite format is MMM' 'd', 'h':'mm':'ss' 'a which for example for today, gives: Thu Nov 20, 10:44 PM. Very Nice. Also, I have not encountered any application specific problems with this.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: cynikal on Nov 20, '03 10:53:25PM

Nice.. this is similar to the one i use..

MMM' 'd' 'hhmm':'ss

Which shows: Nov 20 2249 (it's in 24 hour time). It also says Thu because it's thursday, but that's a function of the 'Display day of week' option in the system preferences for the time/date panel.

As for it not affecting any software, i found my AIM timestamps were screwy after I changed the settings.



[ Reply to This | # ]
warning: may have system wide effects
Authored by: vancenase on Nov 20, '03 11:30:55PM

i used this hint and was pretty excited ... but noticed my iChat windows now do not just display the time ... they display the time 'formatted' how i made my clock look ... exactly ...

this might/could introduce problems down the line ...



[ Reply to This | # ]
Clock Hack breaks Palm Desktop
Authored by: dnsstaiger on Nov 22, '03 08:51:58AM

Attention, after having modified the clock representation, Palm Desktop calendar broke:

Entering an event for 20.00h was converted to 8h am (not pm).

Removing the clock hack solved the problem.



[ Reply to This | # ]
10.3: why not just use ical! ...
Authored by: trevbuck on Nov 22, '03 11:28:20AM

hey dudes , this might be spoiling all your fun typing code in the terminal...
but why not just have iCal as a log in item that is hidden.
That way the date is always in the dock...



[ Reply to This | # ]
10.3: why not just use ical! ...
Authored by: Chuck on Nov 24, '03 11:45:21AM

Perhaps, like myself, many people don't keep their Dock visible all the time (you can toggle hidding and showing the Dock with Cmd-Opt-D). I find the Dock a fairly useless waste of screen real estate, and I only use it for two purposes now that Panther has the center screen icons when switching applicaitons (I use it to control iTunes when I have that running, and I use Prefling to launch a specific preference panel).



[ Reply to This | # ]
wClock
Authored by: DC Watts on Nov 23, '03 05:56:50PM

Made leery by the adverse outcomes of some following this hint, I just recently d/l'd Wolf Software's wClock and am so impressed that I have already chipped in on it (it is donation-ware). It is a nearly perfect app, with just the right feature set and no more. Now, my menubar shows
Sun, Nov 23 5:54 PM
in Aqua blue. No nagging fear of unintended consequences either.



[ Reply to This | # ]
wClock
Authored by: RichB on Nov 24, '03 01:57:11AM

This has many more options than DesktopCalendar as far as date and time formats available for the menu bar! If he added the desktop calendar part I'd dump DesktopCalendar and donate too!



[ Reply to This | # ]
wClock
Authored by: cailliau on Jun 13, '04 01:14:42PM

Yes, wClock is great, except that the only internationally standard date format (ISO & W3C) is not included: YYYY-MM-DD (e.g. 2004-06-13) which I use exclusively, as it is the only format that is application independent and can be used for sorting even if it's just plain text...
I've signalled this omission to the developer and will certainly donate if he includes it.

---
Robert Cailliau



[ Reply to This | # ]
wClock
Authored by: Tom Robinson on May 04, '05 07:20:43PM
It doesn't by default. As jpkelly says further down, you can modify the Defaults.plist. At the bottom of the dateFormats I've added: "%Y-%m-%d", Formats are the same as Unix, do a man strftime for details.

[ Reply to This | # ]
DesktopCalendar
Authored by: RichB on Nov 24, '03 01:42:07AM
I prefer the simple freeware DesktopCalendar. DesktopCalendar is a tiny application that adds a calendar to your desktop. It also shows today's date on the menu bar and has no dock icon in the "status bar or _SB" version. The date is shown short and sweet in the MM/DD or DD/MM format. This is also a MacOSXHints Hall of Fame App!

[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: dagronf on Nov 24, '03 06:39:34AM

After I tried this hint I found that Mail, iCal, and lots of other apps no longer functioned. Going into the International Preference pane and changing the formatting setting fixed the problem.

Just in case others have the same problems, this is a simple solution.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: kinshay on Nov 24, '03 12:32:43PM

This hint seemed to work fine, until I rebooted. The clock and all things added to the bar by preference panes stopped showing (displays, volume, menumeter.) Mail Menu and (and after reading the above comments - wclock) worked fine. This problem is not showing up on the other accounts on my system. I think wclock is a better way to go.



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: jpkelly on Dec 23, '03 04:59:15AM
I submitted this hint but after reading about possible problems I decided to go with wClock. I did modify wClock.app/Contents/Resources/Defaults.plist by adding the line
"%a, %0d",
to the date formats. this gives the option of showing the date like this "Tue, 23" (I usually know the year and the month)

[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: BobHarris on May 02, '05 08:27:42PM

Mac OS X 10.4 (Tiger) has changed the
~/Library/Preferences/.GlobalPreferences.plist
file to a binary file. So now you need to edit the file using the Property List Editor.

From the Applications -> Utilities -> Terminal

cd ~/Library/Preferences/
open .GlobalPreferences.plist

Click on the triangle for 'Root'
Click on the triangle for 'AppleICUTimeFormatStrings'
Double Click on key 2's 'Value' field (far right field)
Change it as you see fit.
Save .GlobalPreferences.plist
Quit Property List Editor
Click on Menubar Date & Time, and change it ot Analog
Click on Menubar Date & Time again, and change it back to Digital
It should now display your new Date & Time format.

I've change mine to :

d'` 'h':'mm':'ss' 'a

Which gives me a menubar Date & Time that looks like:

Mon 2` 8:22 PM

I've used this style menubar Date & Time for several years, and I guess if it is causing problems, I am not uses the apps that it affects.

But I might try one of the suggested menubar Date & Time alternatives anyway.

Bob Harris



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: BobHarris on May 02, '05 08:42:39PM

FYI: wClock still works in Mac OS X 10.4 (Tiger), just in case anyone was wondering.

Bob Harris



[ Reply to This | # ]
10.3: Add the date to the menubar clock
Authored by: agamorim on May 05, '05 02:16:12PM

Hello,

I use a portuguese language. Since 10.2, i think, in the menubar, the inicial of days and months aren´t capitalized! This happened all across the system, every-time i use a date! I see monday, 5 may 2005 instead of Monday, 5 May 2005!

Here, in Portugal, the days names start with a smal letter but the month star with a capital letter. But, in menu bar clock, the day should start with a capital.

How I will be able to modify these patterns?



[ Reply to This | # ]
This hint is now broken
Authored by: Wizardling on Mar 13, '07 10:28:08PM

AppleICUTimeFormatStrings no longer exists :-( I am on 10.3.9.

---
If you're not part of the solution, you're part of the precipitate.



[ Reply to This | # ]