How to set the clock to 24 hour format on Ubuntu Mate 22.04

I can't change the clock to 24 hour format. It used to be a slider button, but with later versions os Ubuntu Mate that has disappeared and is harder and harder to find out how to set it. Please put the slider button back.

1 Like

You're right.
I expected the setting to be in mate-control-center -> indicators -> date and time
but I didn't see it there.
Maybe someone forgot it to put it there, filing a bug would be the logical next thing to do.

Anyway, here is for some workaround (in two different ways):

either

  1. The commandline way:
gsettings set org.gnome.desktop.interface clock-format '24h'

or

  1. The GUI way:
    choose dconf-editor from menu and open it.
    search for 'clock-format'
    You will see this

    click one of the settings (in this example, the first)
2 Likes

Hi another possibility in my UM22.04 I right click on clock / preferences

c

1 Like

Yay !! that is the old panel clock :slight_smile:

Strange, on my install Clock Format is missing from the Clock Preferences options:
old_clock_prefs

The new clock:
mate-control-center -> indicators -> date and time
enough settings but also no Clock Format

1 Like

IDK just clicked add to panel and selected clock. :grin:
Didn't see another choice.
OK disregard my answer, further checking I removed Evolution and thus the ayatana-indicator-datetime which is dependent on it.
Sorry for confusion, but like my adjuster better. :grinning:
Edit: Added strange that a bunch of other ayatana are installed image:

2 Likes

Yes, I like your adjuster also better.
But poor me is missing the 12/24 hour format options switch that you have, and we're both using the same clock on the same UM22.04 so theoretically this can't be happening :slight_smile:
What version is your clock ?
Mine is 1.26.2

(b.t.w. The bunch of installed Ayatana-indicators look like the standard batch you get after install. This is pretty much the same list as in mate-control-center -> startup programs)

1 Like

Here is my version.
v

Edit: Maybe location, I'm in US.?

1 Like

You are right.
When I change my regional settings from NL to US or UK it suddenly shows the 12h/24h radiobuttons.

Is this a bug or a feature ? :grin:

3 Likes

Hello computek45

This is a work-around:

  • Open the Synaptic package manager (you can install it from the software boutique).
  • search for the package "orage" (Calendar for Xfce Desktop Environment)
  • install "orage"

"Orage" should now be visible either via the Applications menu, or the Brisk menu if you are using that.

Note:
This will add a second calender display in your panel (if I remember you may have to add it to the panel yourself). One advantage of "orage" is that when you click it open - it stays open until you click it to make it reduce to the panel.

Hope that helps. :slightly_smiling_face:

2 Likes

Just a note in my UM22.04 the clock stays open until clicking on the title bar. Sorta remember in 20.04 it didn't.

1 Like

Dear Friends,

I found it, after trying everything for 23.04 in case someone lands here.

in dconf it is in org ayatana indicator datetime
one must change from default to '24h'

guessing like this should not work, but sometimes does

-M

1 Like

Hello,

My OS: LUbuntu 22.04 LTS 64bits

For listing settings, type in terminal:
gsettings list-recursively | grep clock

For display the date :
gsettings set org.gnome.desktop.interface clock-show-weekday true

Then remove to the panel the clock and add it again for updating its display (right click and remove, then right click add and select clock)

Hope this helps

2 Likes

Welcome @UbuntuUser to the community!

I was able to finally able to change the clock to 24 hour format and add the day of the week and date.
With the copying and pasting the following commands in the terminal.

gsettings set org.ayatana.indicator.datetime time-format 'custom'
gsettings set org.ayatana.indicator.datetime custom-time-format '%A %m/%d/%y %H:%M%'

4 Likes

Just installed 22.04 and the command line way:
gsettings set org.gnome.desktop.interface clock-format '24h'

Didn't do anything. This is so annoying!

This is ridiculous! Looks like Ubuntu developers have developed a bad case of Windows Registry Envy.

Fresh install of 22.04 and after installing dconf-editor after the command line way didn't work, the GUI way didn't work either!

I understand your frustration.

Since MATE changed to ayatana indicators you probably discovered that the date/time indicator changed too. It is no longer a gnome(mate) panel gadget but a seperate ayatana indicator so the key changed too ofcourse.

The default setting for 12h/24h for ayatana-datetime-indicator is automatically selected based on your regional settings.
You can still override this by invoking

gsettings set org.ayatana.indicator.datetime time-format  '24-hour'

Try to set this and see if it works.

If it doesn't, create your custom format by setting:

gsettings set org.ayatana.indicator.datetime time-format  'custom'
gsettings set org.ayatana.indicator.datetime custom-time-format '%H:%M'

You can lookup the formatcodes you need (like %H %M %s etc.) by invoking:

man strftime

The alternative is to revert to the old date-time indicator instead, by disabling the ayatana version and right-click the panel and add 'clock'.
This would not be the preferred way but if all else fails it might just save your day.

2 Likes

Thanks, It seems to have worked on 22.04 but not 20.04.

Hi Wally,:slight_smile:

I am happy to hear that, because 22.04 was what your question was about. :+1:

If you have questions about 20.04 , sorry I don't have any computer here that runs that old and unsupported version so I can't test it for you.

According to my gradually fading memory it must be either:

gsettings set org.gnome.desktop.interface clock-format '24h'

or

gsettings set org.ayatana.indicator.datetime time-format  '24-hour'

depending on wether you are running the gnome2 or the ayatana version of datetime. (But, as I said, fading memory, so no guarantees)

You are the only one who knows what you are running, so take your pick.
If this doesn't work and you need it badly but can't find anyone to help you:
sudo do-release-upgrade would be possibly a good idea.

3 Likes