21

I want to change the date/time format on the top panel to a format close to RFC 3339 / ISO 8601, like one of these:

%F %T → 2013-06-24 16:13:00

%F %a %T → 2013-06-24 Mon 16:13:00

%A %F %T → Monday 2013-06-24 16:13:00

I know Unity has a preference somewhere hidden away in dconf, this is how I did it in Unity, but I can't find such a preference for Gnome 3 shell. Preferably, I'd also like to set one of these as my system-wide date/time locale preference.

8
  • 1
    possible duplicate of How to configure the clock date format to ISO 8601? Jun 24, 2013 at 15:26
  • 3
    @Radu: Unity shell is not Gnome shell. No, it's not a duplicate of that question. Jun 24, 2013 at 15:35
  • Unfortunately, gnome-shell is a synonym of gnome, when in fact it is only a part of Gnome 3 that is replaced by Unity shell in main Ubuntu. Jun 24, 2013 at 15:39
  • @edwin: Either which way? I don't even have those 2 keys in my dconf. Maybe you should test it yourself, and if you succeed, post an answer back here. Until then, this question is not a duplicate of that one. As I mentioned in the question, I know it's possible in Unity, I've done it before, using those 2 keys, but this is Gnome shell. Can we move on now? Jun 24, 2013 at 16:12
  • 1
    I have been looking here, here, and here. Put so far (at least according to the last 'here') it looks like the API has been modified so the format is inside the C/C++ code. I mean I cannot find anything in the JavaScript API about the WallClock class (which you could use to change the file /usr/share/gnome-shell/js/ui/dateMenu.js).
    – edwin
    Jun 24, 2013 at 17:19

6 Answers 6

17

Open a terminal and set

gsettings set org.gnome.desktop.interface clock-show-date true

YMMW - this did work for me on Fedora 19.

3
  • 1
    … and Fedora22!
    – Dirk
    Feb 7, 2016 at 17:07
  • 9
    The question is asking how to change the format of the date displayed (by the clock and in other places), not how to display the date next to the clock. Dec 2, 2017 at 1:12
  • Works on Ubuntu 18.04 too
    – xarlymg89
    Dec 7, 2018 at 9:21
11

I was ultimately able to achieve my exactly desired format using a GNOME extension made by Daniel Khodabakhsh. Thank you Daniel!

I found that here: https://github.com/Daniel-Khodabakhsh/datetime-format

Screenshot: enter image description here

Format: %A | %m-%d-%G | %I:%M %p

2
  • Where do you write that format? I see a lot of files and directories in the directory installed by that program, but I can't make much sense of it.
    – Andyc
    Jul 18, 2021 at 11:11
  • You write it right were it is shown in the screenshot, using Tweaks (Notice all 3 windows and their stack-order, in the screenshot). @Andyc Jul 19, 2021 at 16:03
7

In addition to what Martin says, the following worked for me on Ubuntu 14.04, where dconf-editor didn't:

gsettings set org.gnome.desktop.interface clock-show-date true
gsettings set org.gnome.desktop.interface clock-show-seconds true
2
  • 3
    As with Martin's answer, the question is asking how to change the format of the date displayed (by the clock and in other places), not how to display the date next to the clock. Dec 2, 2017 at 1:12
  • Fair point, additionally I should probably have left this as a comment on Martin's response
    – seddy
    Jan 22, 2018 at 12:09
4

You can try one of these three extensions:

  • Full Clock

    enter image description here Replaces the default clock with a complete one showing time, date and week day

  • Full Clock 2

    enter image description here Replaces the default clock with a one showing date, week, day of week and time.

  • Format Clock (development discontinued, but apparently working fine in 3.16)

    enter image description here Change top panel clock format.

    It says the develpmont has been discontinued, but I tested it, manually editing metadata.json to include 3.18, and it works:

    enter image description here

4
  • I am unable to install any of those because they do not seem to support 3.18 and it doesn't even seem to download them.
    – user364819
    Dec 27, 2015 at 20:24
  • @ParanoidPanda Format Clock is on Github (see README for instructions), and you can try bernaerts.dyndns.org/linux/76-gnome/… for the others.
    – muru
    Dec 27, 2015 at 20:30
  • 2
    And there is no way of changing any settings in dconf-editor or something to do this rather than installing something?
    – user364819
    Dec 27, 2015 at 20:37
  • @ParanoidPanda nope. The only settings I can find are for just showing the date there.
    – muru
    Dec 27, 2015 at 20:37
2

Partial answer:

Although it doesn't look like the panel clock is easy to format, the calendar menu opened by clicking on it is very easy. Here's a quick hack:

$ sudo vim /usr/share/gnome-shell/js/ui/dateMenu.js

(vim or any other text editor.)

Search for ‘B %d, %Y’, and replace with ‘F’. Save. Press Alt+F2, r, Enter, to restart the shell.

Searching the parent directory reveals a few others that might be worth experimenting with:

$ rgrep -I '%B' /usr/share/gnome-shell/js/ui/

but unfortunately, searching for the abbreviated month name in the panel clock returns nothing here:

$ rgrep -I '%b' /usr/share/gnome-shell/

Any changes to these file will probably be overwritten by updates to Gnome, and you may want to keep the originals of files you edit (sudo mv [name].js [name].js.orig).

1
  • It's worth doing with calendar.js as well; there are 2 relevant lines in the _showOtherDay function. Jun 24, 2013 at 18:57
0

On Ubuntu 19.10:

gsettings set org.gnome.desktop.interface clock-show-weekday true
gsettings set org.gnome.desktop.interface clock-show-seconds true

etc.

Or, run

dconf-editor

and go to org.gnome.desktop.interface. You will find clock-show-weekday, clock-show-seconds, clock-show-date and others.

1
  • 1
    Not an answer to the question
    – vanadium
    Mar 5, 2022 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .