date
conversion specifiers related to dates.
locale’s abbreviated weekday name (e.g., ‘Sun’)
locale’s full weekday name, variable length (e.g., ‘Sunday’)
locale’s abbreviated month name (e.g., ‘Jan’)
locale’s full month name, variable length (e.g., ‘January’)
locale’s date and time (e.g., ‘Thu Mar 3 23:05:25 2020’)
century. This is like ‘%Y’, except the last two digits are omitted. For example, it is ‘20’ if ‘%Y’ is ‘2019’, and is ‘-0’ if ‘%Y’ is ‘-001’. It is normally at least two characters, but it may be more.
day of month (e.g., ‘01’)
date; same as ‘%m/%d/%y’
day of month, space padded; same as ‘%_d’
full date in ISO 8601 format; like ‘%+4Y-%m-%d’ except that any flags or field width override the ‘+’ and (after subtracting 6) the ‘4’. This is a good choice for a date format, as it is standard and is easy to sort in the usual case where years are in the range 0000…9999.
year corresponding to the ISO week number, but without the century (range ‘00’ through ‘99’). This has the same format and value as ‘%y’, except that if the ISO week number (see ‘%V’) belongs to the previous or next year, that year is used instead.
year corresponding to the ISO week number. This has the same format and value as ‘%Y’, except that if the ISO week number (see ‘%V’) belongs to the previous or next year, that year is used instead. It is normally useful only if ‘%V’ is also used; for example, the format ‘%G-%m-%d’ is probably a mistake, since it combines the ISO week number year with the conventional month and day.
same as ‘%b’
day of year (‘001’…‘366’)
month (‘01’…‘12’)
quarter of year (‘1’…‘4’)
day of week (‘1’…‘7’) with ‘1’ corresponding to Monday
week number of year, with Sunday as the first day of the week (‘00’…‘53’). Days in a new year preceding the first Sunday are in week zero.
ISO week number, that is, the week number of year, with Monday as the first day of the week (‘01’…‘53’). If the week containing January 1 has four or more days in the new year, then it is considered week 1; otherwise, it is week 53 of the previous year, and the next week is week 1. (See the ISO 8601 standard.)
day of week (‘0’…‘6’) with 0 corresponding to Sunday
week number of year, with Monday as first day of week (‘00’…‘53’). Days in a new year preceding the first Monday are in week zero.
locale’s date representation (e.g., ‘12/31/99’)
last two digits of year (‘00’…‘99’)
year. This is normally at least four characters, but it may be more. Year ‘0000’ precedes year ‘0001’, and year ‘-001’ precedes year ‘0000’.