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

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'