13

By default, Raspbian displays a 24-hour clock:

enter image description here

Normally, LXDE provides an option to change the clock format by opening Panel Preferences, selecting "Digital Clock", and clicking Preferences. However, this is disabled:

enter image description here

How do I change the format?

Nathan Osman
  • 538
  • 2
  • 4
  • 17
  • Clock settings were re-enabled in Raspbian Stretch (v9). Change the time format by right-clicking the time and selecting "digital clock settings". – Stevoisiak Apr 11 '18 at 01:46

4 Answers4

13

First, the rationale for this:

"And with regards the clock plug-in – yes, I’ve disabled the config for the time being. The clock plug-in was a nightmare from a UI point of view. For example – popping up the calendar gives you a calendar window in which you can move a highlight to show a different day – for no purpose at all. It contained a lot of kludgey hacked code for the benefit of someone who wanted the option to have their clock in bold font."

Simon Long

Now for the fix. Open a terminal and run:

leafpad /home/pi/.config/lxpanel/LXDE-pi/panels/panel

(Substitute leafpad with a console editor such as vi or nano if desired.)

Locate the following line:

ClockFmt=%R

...and change it to:

ClockFmt=%r

Save the file and either reboot or restart LXDE.

Nathan Osman
  • 538
  • 2
  • 4
  • 17
  • As of Raspbian Stretch (v9), clock settings were re-enabled. You can right click the time and select "Digital clock settings" – Stevoisiak Apr 11 '18 at 02:02
9

Changing the format of the time using either Ken's or Nathan's way works, but there is another difference between %R and %r. %r also shows the seconds ticking off. If you want them, great. If not, then you need to specify a different format, like %I:%M %p.

For a full list of formatting codes, see Customizing The Clock (from archive.org)

Jim
  • 392
  • 5
  • 10
5

Use %I:%M %p instead

The seconds from %r are annoying and useless.

dhchdhd
  • 151
  • 1
  • 2
  • This should probably be a comment on another answer, rather than an answer on its own. – Bex Aug 21 '17 at 07:21
  • Welcome to Raspberry Pi! This duplicates another answer (https://raspberrypi.stackexchange.com/a/41175/19949) and adds no new content. Please don't post an answer unless you actually have something new to contribute. – Ghanima Aug 21 '17 at 08:36
1

On Pi 2, I have found right clicking on the clock, click digital clock settings, on clock format, change %R to %r

Ken
  • 11
  • 1