28

Presently the date is showing as mmm dd hh:mm:ss. Is there any way that I can change it to as per my liking. For example : dd mmm, hh:mm:ss.

Jorge Castro
  • 71,754
Arindom
  • 8,182
  • Look at this link. – karthick87 May 20 '11 at 07:50
  • Nothing seems to have changed. I tried manually inserting the coded instruction as well as dconf editor. The date still shows up as Mon Apr 21, 21:24 in the upper right corner of the desktop and same in Thunderbird! –  Apr 21 '14 at 19:26
  • I am surprised there is no simpler way of doing this like a small application added to System Settings where one can chose the date format with a click rather than having to go through such lengths! By the time I've read through the solution, I would have almost forgotten what my difficulty was in the first place! – Bumblebee001 Apr 21 '14 at 23:45
  • In 14.04, this answer worked for me: http://askubuntu.com/questions/237941/how-to-configure-the-clock-date-format-to-iso-8601-in-unity – mcaleaa Jan 14 '15 at 10:20

2 Answers2

40

Terminal method

  • First you need to tell the indicator to use a custom format. To do so, run this from a gnome-terminal:

    gsettings set com.canonical.indicator.datetime time-format "'custom'"
    
  • Then you need to tell the indicator which format to use. This has to be done in a format understood by the strftime function. You can look it up here.

    For example, if you want the date/time to look like this: Fri, 20. May 08:25, the format string for it would be %a, %d. %h %H:%M. Now let's set it:

    gsettings set com.canonical.indicator.datetime custom-time-format "'%a, %d. %h  %H:%M'"
    

GUI method

You can also set those keys using a GUI called dconf-editor. It's part of the package dconf-tools, which you'd need to install first by running sudo apt-get install dconf-tools. Then open dconf-editor, navigate to com.canonical.indicator.datetime, and set the two keys.

screenshot of <code>dconf-editor</code> at <code>com.canonical.indicator.datetime</code> schema

wjandrea
  • 14,236
  • 4
  • 48
  • 98
htorque
  • 64,798
  • Worked great for me. I was just looking for this solution. Many many thanks htorque. – Arindom May 20 '11 at 12:59
  • 1
    I'm running 11.10, and I don't see any settings in com.canonical.indicator.datetime; is anyone else experiencing this? – Mike Partridge Nov 10 '11 at 03:02
  • @MikePartridge Nope, I'm still having the key and can set the date like described. Make sure you have the package indicator-datetime installed. – htorque Nov 10 '11 at 05:34
  • @MikePartridge: On my systems (laptop and netbook), it looks like the settings are all squashed into the top of the window; there is a tiny scrollbar, but the box is too small to see any text and you can't edit anything. Effectively useless. This kind of rubbish is gonna make me ditch Unity, after giving it a serious test-run. – SabreWolfy Jan 04 '12 at 08:37
  • +1 just for the "Then you need to tell the indicator which format to use. This has to be done in a format understood by the strftime function. You can look it up here." - I wasn't sure what format strings they were using, and found that reference awesome. Thanks! – Breakthrough Dec 01 '12 at 19:01
  • 3
    This answer still works for 16.04. I'd vote it again if I could. – amotzg Aug 16 '16 at 06:18
  • 2
    this dconf setting no longer exists in 18.04 – krock Jan 12 '19 at 13:04
-1

Ubuntu 14.04. I don't want to install dconf-editor.

I just tried the following in a terminal:

$ gsettings set com.canonical.indicator.datetime custom-time-format "'%a %Y%m%d-%H%M%S'"
$ 

As you can see, there are no error messages or anything.

I then log out and log back in, but there has been no change to my clock display, which is currently %a %b %e %Y %T.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
  • 1
    It's fixed now. They key to success is:

    gsettings set com.canonical.indicator.datetime time-format "'custom'"

    followed immediately by

    gsettings set com.canonical.indicator.datetime custom-time-format "'%a %Y%m%d-%H%M%S'

    – el_gallo_azul Mar 28 '15 at 03:28
  • 1
    This should be a comment and not an answer. An answer should fully answer the question. That is why you can comment on questions as well as being able to post an answer. –  May 03 '17 at 20:17
  • 1
    The accepted answer already has all the info from your answer and your comment. – wjandrea May 04 '17 at 19:21