Custom Time Format in Gnome Panel Clock

    If I don't remember what day of the week it is I'll just click my clock applet and see, thank you, so why do I need a really obnoxious timestamp on my panel clock? I would personally much prefer it if I could just see the time in ISO 8601 format and move on with my day, and that's what I did.

    The gnome clock applet uses strftime() to generate the time displayed on the applet, and luckily for us they provided a hidden gconf key to set a custom time format, why this isn't actually made visible in a settings dialog is beyond me (hey, gnome devs, here is an option you should actually show, at least provide better presets), but oh well. Fire up gconf-editor and browse to /apps/panel/applets/clock_screenX/prefs, where X is the appropriate screen number, usually 0. You'll find two keys worth note custom_format and format.

Key Descriptions:

format
This key specifies the hour format used by the clock applet. Possible values are "12-hour", "24-hour", "internet", "unix" and "custom". If set to "internet", the clock will display Internet time. The Internet time system divides the day into 1000 ".beats". There are no time zones in this system, so time is the same all over the world. If set to "unix", the clock will display time in seconds since Epoch, i.e. 1970-01-01. If set to "custom", the clock will display time according to the format specified in the custom_format key.

custom_format
This key specifies the format used by the clock applet when the format key is set to "custom". You can use conversion specifiers understood by strftime() to obtain a specific format. See the strftime() manual for more information.

    If it's not obvious already, you should set the format key to 'custom', if there's nothing in custom_format yet your clock will show nothing until you do. Now, if you want ISO 8601 (read: proper) time set custom_format to the following:

%Y-%m-%d %H:%M

    If you want some other crazy time format read up on the manpage for strftime manpage. So there you have it, you can set the time format in the gnome panel clock to whatever you please.

PS. if there are any gnome developers reading this, please add a sane regional settings API so every gnome app can stop being stupid and display time in the proper format, Windows has had this for years and I fail to see why it hasn't been taken care of yet.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

You can customize it a lot more than you think...

snuxoll's picture

...

Wow, I didn't even know that was there, that's quite impressive! It's really amazing how much undocumented functionality gnome has these days.

Stefan Nuxoll

run gconf-editor as regular user

I was running it as sudo, and couldn't understand why my menus looked different than what everyone else was talking about.

Once I ran as a regular user, your instructions worked perfectly. Thanks!

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options