Next: Literal conversion specifiers, Previous: Time conversion specifiers, Up: date invocation [Contents][Index]
date
conversion specifiers related to dates.
%a
’Sun
’)%A
’Sunday
’)%b
’Jan
’)%B
’January
’)%c
’Thu Mar 3 23:05:25 2005
’)%C
’%Y
’, except the last two digits are omitted. For example, it is ‘20
’ if ‘%Y
’ is ‘2000
’, and is ‘-0
’ if ‘%Y
’ is ‘-001
’. It is normally at least two characters, but it may be more.%d
’01
’)%D
’%m/%d/%y
’%e
’%_d
’%F
’%+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.%g
’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.%G
’%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.%h
’%b
’%j
’001
’…‘366
’)%m
’01
’…‘12
’)%q
’1
’…‘4
’)%u
’1
’…‘7
’) with ‘1
’ corresponding to Monday%U
’00
’…‘53
’). Days in a new year preceding the first Sunday are in week zero.%V
’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.)%w
’0
’…‘6
’) with 0 corresponding to Sunday%W
’00
’…‘53
’). Days in a new year preceding the first Monday are in week zero.%x
’12/31/99
’)%y
’00
’…‘99
’)%Y
’0000
’ precedes year ‘0001
’, and year ‘-001
’ precedes year ‘0000
’.Next: Literal conversion specifiers, Previous: Time conversion specifiers, Up: date invocation [Contents][Index]