Linux Digital Clock Format (strftime)

To display seconds on the Raspberry Pi OS digital clock, you need to modify the clock settings on the taskbar. Here are the steps to achieve that:

Raspberry Pi OS Digital Clock Settings
  1. Accessing the Clock Settings: a. Right-click on the clock at the top-right corner of the Raspberry Pi OS desktop. b. From the context menu, select ‘Digital Clock Settings’ or a similar option (the name might vary slightly based on the version of Raspberry Pi OS you’re using).
  2. Adjusting Clock Format: a. In the Digital Clock Settings window, find the field named ‘Clock Format’ or ‘Format’. b. This field determines how the time is displayed. You’ll typically see some format strings like %H:%M which stands for Hour:Minute in 24-hour format. c. To add seconds, modify the string to %H:%M:%S. The %S denotes seconds. d. Once done, click ‘OK’ or ‘Apply’ to save the changes.
  3. The digital clock on your taskbar should now display hours, minutes, and seconds.

Note: The format strings are based on the strftime function format. You can further customize the time and date format using various codes. If you’re interested, you can look up strftime format codes online for more details.

The strftime function in the C programming language provides a way to format time and date. It’s used in various systems and software, and many programming languages provide similar functionality based on the C’s strftime.

Here’s a list of common strftime codes:

  • %a : Abbreviated weekday name (e.g., Wed).
  • %A : Full weekday name (e.g., Wednesday).
  • %b : Abbreviated month name (e.g., Jan).
  • %B : Full month name (e.g., January).
  • %c : Locale’s appropriate date and time representation.
  • %C : Century (year divided by 100, range 00 to 99).
  • %d : Day of the month as a zero-padded decimal number (e.g., 01 to 31).
  • %D : Equivalent to %m/%d/%y (e.g., 04/08/21).
  • %e : Day of the month as a space-padded number (e.g., 1 to 31).
  • %F : Equivalent to %Y-%m-%d (e.g., 2021-04-08).
  • %H : Hour (24-hour clock) as a zero-padded decimal number (e.g., 00 to 23).
  • %I : Hour (12-hour clock) as a zero-padded decimal number (e.g., 01 to 12).
  • %j : Day of the year as a zero-padded decimal number (e.g., 001 to 366).
  • %m : Month as a zero-padded decimal number (e.g., 01 to 12).
  • %M : Minute as a zero-padded decimal number (e.g., 00 to 59).
  • %p : Locale’s equivalent of either AM or PM.
  • %r : Time in AM or PM notation (e.g., 08:08:08 PM).
  • %R : Equivalent to %H:%M.
  • %S : Second as a zero-padded decimal number (e.g., 00 to 59).
  • %T : Equivalent to %H:%M:%S.
  • %u : Weekday as a number, where Monday is 1 and Sunday is 7.
  • %U : Week number of the year (Sunday as the first day of the week) as a zero-padded decimal number.
  • %V : ISO 8601 week number of the year with Monday as the first day of the week.
  • %w : Weekday as a decimal number, where Sunday is 0 and Saturday is 6.
  • %W : Week number of the year (Monday as the first day of the week).
  • %x : Locale’s appropriate date representation.
  • %X : Locale’s appropriate time representation.
  • %y : Last two digits of the year (e.g., 21 for 2021).
  • %Y : Full year (e.g., 2021).
  • %z : UTC offset in the form +HHMM or -HHMM.
  • %% : A literal % character.

You can combine these codes in various ways to create custom date and time formats. For example, %A, %B %d, %Y would produce “Wednesday, April 08, 2021”.

Did you like this?
Tip cyberfella with Cryptocurrency

Donate Bitcoin to cyberfella

Scan to Donate Bitcoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to cyberfella

Scan to Donate Bitcoin Cash to cyberfella
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to cyberfella

Scan to Donate Ethereum to cyberfella
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to cyberfella

Scan to Donate Litecoin to cyberfella
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to cyberfella

Scan to Donate Monero to cyberfella
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to cyberfella

Scan to Donate ZCash to cyberfella
Scan the QR code or copy the address below into your wallet to send some ZCash:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.