How to change the date and time format of clock in panel of Ubuntu

Problem

The Clock on the Panel in Ubuntu displays the time. You can enable it to display the date and day of the week by changing its settings. It displays this information in this format:

Fri Apr 2 02:10 PM

I prefer the following format for date and time display:

2010-04-02 Fri 14:10

The date and time format can be changed to anything that you are comfortable with.

Ubuntu 12.04 and later

Changing date-time format in Ubuntu
Changing date-time format in Ubuntu

Here is how to change the date and time format of the panel clock to your liking:

  1. Install the package dconf-tools from the Ubuntu repositories. This installs the dconf-editor which is needed for changing the configuration.

  2. Open dconf editor from the Dash or dconf-editor from the shell. In the editor, navigate to com.canonical.indicator.datetime.

  3. Change the time-format field to custom.

  4. In the custom-time-format field, change the value to the desired format. The format can include both the date and time specifiers. This format uses the same specifiers as that of the C standard library function strftime().

To change to my desired format, I use:

%Y-%m-%d %a %H:%M
2010-04-02 Fri 14:10

The changes should take effect immediately and the date-time should change in the panel.

Tried with: Ubuntu 12.04 and Ubuntu 14.04

Ubuntu 10.04 and older

Use gconf-editor. Navigate to /apps/panel/applets/clock_screen0/prefs. Change format field to the string custom. Change the custom_format field as described above.

Advertisements

5 thoughts on “How to change the date and time format of clock in panel of Ubuntu

  1. Dear Ashwin,

    I do not have the path “/apps/panel/applets/clock_screen0/pref” .

    The most similar ones I can find are “/apps/panel/default_setup/applets/clock”; and there is no “format” field there.

    There is no clock in “/apps/panel/applets”.

    Please help me.

    I am using ubuntu 10.04 64 bit.

    Like

  2. you can also use your console like this:
    gconftool-2 –set “/apps/panel/applets/clock_screen0/prefs/format” –type string “custom”

    gconftool-2 –set “/apps/panel/applets/clock_screen0/prefs/custom_format” –type string “%Y-%m-%d %a %H:%M

    🙂

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s