Skip to content

Date format tokens

Noctalia date and time settings render the current local time. Clock widgets, shell.time_format, shell.date_format, and other date-format settings use the same token set when they need user-configurable date or time output.

You can write either a bare strftime pattern such as %H:%M, or wrap the same pattern in a C++ chrono field such as {:%H:%M}. Literal text is copied through, \n becomes a line break, %% prints a literal percent sign, and {{ / }} print literal braces when a format uses brace fields.

Percent tokens are resolved with the system strftime(3) formatter, so localized names and locale-preferred formats follow LC_TIME, and timezone values follow the local system timezone.

For example, if the current local time is Monday, May 4, 2026 at 09:05:07:

FormatExample output
%H:%M09:05
{:%H:%M}09:05
{:%-I:%M %p}9:05 AM
{:%A}\n{:%Y-%m-%d}Monday then 2026-05-04 on the next line
TokenMeaning
%HHour on a 24-hour clock, 00 to 23
%kHour on a 24-hour clock, space-padded 0 to 23 (glibc)
%IHour on a 12-hour clock, 01 to 12
%lHour on a 12-hour clock, space-padded 1 to 12 (glibc)
%MMinute, 00 to 59
%SSecond, 00 to 60
%pLocale AM/PM marker
%PLocale lowercase am/pm marker (glibc)
%R24-hour time, equivalent to %H:%M
%T24-hour time with seconds, equivalent to %H:%M:%S
%rLocale 12-hour time, commonly %I:%M:%S %p
%XLocale time representation
%zNumeric timezone offset, such as -0400
%ZTimezone name or abbreviation
%sSeconds since the Unix epoch (timezone extension)
TokenMeaning
%YYear with century, such as 2026
%yYear without century, 00 to 99
%CCentury number, year divided by 100
%mMonth number, 01 to 12
%BFull localized month name
%bAbbreviated localized month name
%hSame as %b
%dDay of month, 01 to 31
%eDay of month, space-padded 1 to 31
%FISO date, equivalent to %Y-%m-%d
%DDate, equivalent to %m/%d/%y
%xLocale date representation
%cLocale date and time representation
TokenMeaning
%AFull localized weekday name
%aAbbreviated localized weekday name
%uISO weekday number, 1 Monday through 7 Sunday
%wWeekday number, 0 Sunday through 6 Saturday
%jDay of year, 001 to 366
%UWeek number, 00 to 53, Sunday as first day of week
%WWeek number, 00 to 53, Monday as first day of week
%VISO week number, 01 to 53
%GISO week-based year with century
%gISO week-based year without century
TokenMeaning
%%Literal %
%nNewline
%tTab

Modifiers go between % and the token letter. They are handled by the system strftime(3) implementation.

ModifierExampleMeaning
-%-d, %-INo padding for numeric output
_%_dSpace padding for numeric output
0%0eZero padding for numeric output
^%^BUppercase alphabetic output
#%#ZSwap case where supported
width%5m, %_5mMinimum field width
E%Ec, %EC, %Ex, %EX, %Ey, %EYLocale alternative era-based form
O%Od, %Oe, %OH, %OI, %Om, %OM, %OS, %Ou, %OU, %OV, %Ow, %OW, %OyLocale alternative numeric symbols

Locale alternatives fall back to the unmodified token when the active locale does not define an alternative. The glibc man page lists %+, but glibc does not support it; use an explicit pattern instead.