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?

1
  • Clock settings were re-enabled in Raspbian Stretch (v9). Change the time format by right-clicking the time and selecting "digital clock settings".
    – Stevoisiak
    Commented Apr 11, 2018 at 1:46

4 Answers 4

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.

1
  • As of Raspbian Stretch (v9), clock settings were re-enabled. You can right click the time and select "Digital clock settings"
    – Stevoisiak
    Commented Apr 11, 2018 at 2: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)

4
  • Though I like to put %r in the tooltip so the full tooltip is now %A %x %r.
    – Andrew
    Commented Nov 5, 2017 at 23:49
  • That incredibly informative link is now dead :((
    – Xbox One
    Commented Feb 17 at 17:16
  • @XboxOne. I found the old page in archive.org and updated the above link to display that instead of the original page.
    – Jim
    Commented Feb 18 at 20:50
  • @Jim awesome, that page is actually so useful.
    – Xbox One
    Commented Feb 20 at 17:45
6

Use %I:%M %p instead

The seconds from %r are annoying and useless.

2
  • This should probably be a comment on another answer, rather than an answer on its own.
    – Bex
    Commented Aug 21, 2017 at 7:21
  • Welcome to Raspberry Pi! This duplicates another answer (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
    Commented Aug 21, 2017 at 8:36
1

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

1
  • Note: his issue is that he CAN'T get to those digital clock settings.
    – Brian
    Commented Oct 25, 2015 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.