How to change time display to 12h time format in Ubuntu

I have installed Ubuntu 18.04 and I have the following issue:

I tried to change the date on the top panel to 12h format instead of the default 24h format but I found no editable option into settings or gnome-tweaks tool.

I hope to find help here.

Answers 3

  • There are several ways:

    1. From GUI (Settings):

      Open Settings >Details> Date & Time. Then pick either 24 hrs or am/pm

    2. From GUI (using dconf-editor)

      Open dconf Editor (not installed by default, run

      sudo apt install dconf-editor
      

      to install), and browse to org > gnome > desktop > interface > clock-format, and change the format to '12h'

      enter image description here

    3. From command line:

      Run the command:

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

      To revert:

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

  • To run the following commands, first install the dconf-editor package:

    sudo apt install dconf-editor
    

    Then run this command, to switch to 12-hour mode:

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

    If you ever want to revert to 24-hour mode, you can do so by running:

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