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


Click here to return to the 'Why not just fix the regular clock?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why not just fix the regular clock?
Authored by: jolshefsky on Aug 13, '03 02:11:17PM
Ok, so it's a really hackish hack. And all you get is that you can see the date in the menu clock.

Here's what I just did:

  1. In terminal:
    cd /System/Library/Core\ Services/Menu\ Extras/Clock.menu/Contents/Resources
  2. Change to the directory of your language. For English, cd English.lproj.
  3. I needed a way to edit the root-owned Localizable.strings file, so I just did:
    sudo cp Localizable.strings ~/loc.txt
    open -a /Applications/TextEdit.app ~/loc.txt
    You can edit the file with any Unicode-compatible editor, and TextEdit was an easy choice.
  4. Modify the entry MBC_CLOCK_FORMAT_STRING to include the date in the format you want. I changed it to "%a %time%p %b-%e" which displays the 3-letter month, a hyphen, and the day-of-the-month after the time. You can test what the date will look like with the date command as in:
    date +%b-%e
    which will display the date in the format indicated after the plus-sign (+).
  5. Save the file.
  6. Copy the file back into place with
    sudo cp ~/loc.txt Localizable.strings
  7. The easiest way I found to restart the menu clock was to log out and log back in again. I assume you can kill some process then restart it, but I was too scared to try.

In the end, voila! The date is displayed in the menu.

[ Reply to This | # ]

re: Why not just fix the regular clock?
Authored by: mclbruce on Aug 14, '03 12:54:50AM

Nice modification! If I had known about this earlier i wouldn't have spent so much time modifying wClock :-)



[ Reply to This | # ]
Why not just fix the regular clock?
Authored by: Frederico on Aug 14, '03 12:19:53PM

Personally I prefer the quicker way:

1) Open a Terminal Window
2) type:

defaults write .GlobalPreferences NSTimeFormatString %y%m%d %1I:%M:%S

(for more information on possible settings, type 'man strftime')

3 Open System Prefs > Date & Time > Menu Bar Clock
4) Toggle the 'Show clock in menu bar' checkbox OFF, then back ON.

CAUTION: subsequent use of any settings in the Date & Time Prefs Pane will override your settings.

HINT: you can AppleScript the changes in case you want to rapidly add such changes to a new user environment, or when you have to delete your .GlobalPreferences file due to corruptions, or when you forget the above caution. (;

do shell script "defaults write .GlobalPreferences NSTimeFormatString %y%m%d %1I:%M:%S"

(the above should appear on one line)

Explore GUI scripting to automate the menubar toggling, or simply logout/login.



[ Reply to This | # ]
Why not just fix the regular clock? I'd like to but...
Authored by: rgray on Aug 26, '03 10:01:29AM

I did this...
[Robert-Grays-Computer:~] me% defaults write .GlobalPreferences NSTimeFormatString %y%m%d %1I:%M:%S

And got this....
2003-08-26 09:59:07.106 defaults[422] Unexpected argument %1I:%M:%S; leaving defaults unchanged.

?????



[ Reply to This | # ]
Why not just fix the regular clock? I'd like to but...
Authored by: wardy on Aug 28, '04 04:02:49AM

I think you might need "quotes" around the value with a space imbedded.

Still, I tried it but it didn't work. Haven't given up yet though :)



[ Reply to This | # ]