Date and Time Formatting Patterns

The message content generator can use the date and time formatting patterns listed here. Content for all the below listed patterns are generated using the locale en_us utf-8.

To use the pattern, write it after the placeholder, using the '|' sign as the delimiter. For example:

{date} = 2006-07-19
{ETA} = 16:00

{ETA|%R} = 16:00
{ETA|%H:%M} = 16:00

{ETA|%r} = 04:00:00 PM
{ETA|%I:%M %p} = 04:00 PM
{ETA|%I:%M:%S %p} = 04:00:00 PM

{date|%A, %d %b %G} = Wed, 19 Jul 2006
{ETA|%A, %d %b %G %I:%M} = Wednesday, 19 Jul 2006 04:00 PM
Format Description
%A Replaced with the full weekday name.
%a Replaced with the abbreviated weekday name.
%B Replaced with the full month name.
%b Replaced with the abbreviated month name.
%C Replaced with (year / 100) as decimal number; single digits are preceded by a zero.
%c Replaced with the time and date.
%D equivalent to %m/%d/%y.
%d Replaced with the day of the month as a decimal number (01-31).
%E, %O* POSIX locale extensions. The sequences %Ec %EC %Ex %EX% Ey %EY %Od %Oe %OH %OI %Om %OM %OS %Ou %OU %OV %Ow %OW %Oy are supposed to provide alternate representations. Additionally, %OB is implemented to represent alternative months names (used Standalone, without day mentioned).
%e Replaced with the day of month as a decimal number (1-31); single digits are preceded by a blank.
%F Equivalent to %Y-%m-%d.
%G Replaced with a year as a decimal number with century. This year is the one that contains the greater part of the week (Monday as the first day of the week).
%g Replaced with the same year as in %G, but as a decimal number without century (00-99).
%H Replaced with the hour (24-hour clock) as a decimal number (00-23).
%h Same as %b.
%I Replaced with the hour (12-hour clock) as a decimal number (01-12).
%j Replaced with the day of the year as a decimal number (001-366).
%k Replaced with the hour (24-hour clock) as a decimal number (0-23); single digits are preceded by a blank.
%l Replaced with the hour (12-hour clock) as a decimal number (1-12); single digits are preceded by a blank.
%M Replaced with the minute as a decimal number (00-59).
%m Replaced with the month as a decimal number (01-12).
%n Replaced with a new line.
%O* Same as %E*.
%p Replaced with either "ante meridiem" or "post meridiem" as appropriate.
%R Equivalent to %H:%M.
%r Equivalent to %I:%M:%S %p.
%S Replaced with the second as a decimal number (00-60).
%s Replaced with the number of seconds since the Epoch, UTC (see mktime(3)).
%T Equivalent to %H:%M:%S
%t Replaced with a tab.
%U Replaced with the week number of the year as a decimal number (00-53) with Sunday being the first day of the week.
%u Replaced with the weekday as a decimal number (1-7) with Monday being the first day of the week.
%V Replaced with the week number of the year as a decimal number (01-53) with Monday being the first day of the week. If the week containing January 1 has four or more days in the new year, then it is week 1; otherwise it is the last week of the previous year, and the next week is week 1.
%v Equivalent to %e-%b-%Y
%W Replaced with the week number of the year as a decimal number (00-53) with Monday being the first day of the week.
%w Replaced with the weekday as a decimal number (0-6) with Sunday being the first day of the week.
%X Replaced with the time.
%x Replaced with the date.
%Y Replaced with the year with century as a decimal number.
%y Replaced with the year without century as a decimal number (00-99).
%+ Replaced with the date and time (the format is similar to that produced by date(1)).
%-* Suppress padding when performing numerical outputs.
%_* Explicitly specify space for padding.
%0* Explicitly specify zero for padding.
%% Replaced with %.