Change Clock Format for Raspberry Pi Desktop

Change Raspberry Pi Desktop Clock Format
Change Raspberry Pi Desktop Clock Format.

Introduction to Raspberry Pi Desktop Clock:

Notably, after using your Raspberry Pi Desktop, you may have noticed the clock displays time in the 24-hour format. In fact, a 12-hour clock format is more popular. Consequently, the Raspberry Pi Desktop Clock menu settings allow you to change clock format to the 12-hour clock. Additionally, many other formats for date and time are available.

Placing the mouse cursor over the desktop clock opens a small popup window. As a result, the current date is displayed in the popup window. In the event that both the date and time are desired for display, the clock format can be changed.

In fact, the Raspberry Pi Desktop Clock is very flexible and there are several clock formats that may be used. Additionally, the clock formats are easy to customize and change clock on Raspberry Pi Desktop.

Change Clock Format Using GUI:

There are a couple of methods at your disposal that you may use to change the desktop clock format. One method uses the desktop GUI interface and the other requires changing a configuration file. Later in this post I will show how you can change the clock format using Terminal and a text editor.

However, for now let us stick to the Raspberry Pi Desktop GUI interface. Using the GUI is quick, fun, and so easy even a Stormtrooper for the Empire can do it.

Digital Clock Settings:

Right click on the Raspberry Pi desktop clock and select the Digital Clock Settings menu item as shown below:

Using Raspberry Pi Desktop, right click over clock to select Digital Clock Settings menu item.

Change Clock Format:

Consequently, you should see a different popup window with the Clock Format text box field. In this field you may see the percent symbol followed by a capital R character. The Clock Format string of %R displays the time in the 24-hour clock format with the hour, minutes, and no seconds.

Change the %R Clock Format to %r and see what happens. As a result, of changing the Clock Format you should now see a 12-hour Clock format with hours, minutes, seconds, and either am or pm.

See below for a picture showing the new Desktop Clock Format.

Change how the date and time are displayed using Clock Format Strings in Raspberry Pi Digital Clock Settings.

Of course, if you are like me you may not be a big fan of showing the seconds ticking away like a time bomb. Not to mention wasting extra CPU cycles. So, if you are brave soul follow me here and I will show you how to use multiple clock format strings. In addition, you can include the colon and space as literal characters adding readability.

Enter the following clock format string below for a 12-hour clock without seconds:

%I:%M %p

Accordingly, your Raspberry Pi Desktop Clock should look like the following:

Change Raspberry Pi Desktop Digital Clock to a 12 hour format.

Generally speaking, it really is that simple. If you would like to see the day of the week, date and time try this clock format string below:

%a %b %d, %Y - %I:%M %P

More Clock Format Strings:

Then again maybe you want to try a different clock format. Check out my page here for a list of a comprehensive Clock Formats you may use including formats that display, day, week, month, and year in just about any way imaginable.

https://piwithvic.com/clock-format-for-raspberry-pi-desktop-clock

Change Clock Format Using Terminal or Text Editor:

In the event that you enjoy editing text files you can change your Raspberry Pi Desktop Clock Format as follows:

Open the Terminal application from the Desktop. The desktop has a configuration file where the clock format is stored. Using vi as shown or your favorite text editor such as nano edit the following file if you are logged in as the user pi:

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

Or

vi ~/.config/lxpanel/LXDE-pi/panels/panel

Note: The ~ character as used here is an alias for your Home Directory.

An example is provided below:

Using vi, nano or your favorite text editor, open Raspberry Pi Desktop Panel Configuration file in Terminal application.

Once the configuration file is open scroll down to the area that has the clock format configuration string. The following picture shows the area of the configuration file you are looking for:

Using text editor to modify clock format in panel configuration for Raspberry Pi Desktop.

Once you are confident you made the change being extra careful you will need to restart the desktop or Reboot your Raspberry Pi. After the restart you should see the new clock format on your Desktop. In this example I am showing how to reboot using:

sudo reboot
Use sudo reboot for rebooting system after making panel configuration change for desktop clock format.

Summary:

In the event that you want to change your desktop clock, you now have the power to do it. With Clock Format Strings, the sky is the limit to what you can do. Change Clock using the GUI or by Command Line in Terminal. See link above for more clock format strings. Let me know if this post article was useful, or if you come up with a cool clock format, share it here at Pi with Vic.

Do not forget to have fun and remember, never underestimate the power of Raspberry Pi…

Regards,

Vic