@@ -2076,7 +2076,7 @@ format codes.
2076
2076
| | where 0 is Sunday and 6 is | | |
2077
2077
| | Saturday. | | |
2078
2078
+-----------+--------------------------------+------------------------+-------+
2079
- | ``%d `` | Day of the month as a | 01, 02, ..., 31 | |
2079
+ | ``%d `` | Day of the month as a | 01, 02, ..., 31 | \( 9) |
2080
2080
| | zero-padded decimal number. | | |
2081
2081
+-----------+--------------------------------+------------------------+-------+
2082
2082
| ``%b `` | Month as locale's abbreviated || Jan, Feb, ..., Dec | \( 1) |
@@ -2089,29 +2089,29 @@ format codes.
2089
2089
| | || Januar, Februar, ..., | |
2090
2090
| | | Dezember (de_DE) | |
2091
2091
+-----------+--------------------------------+------------------------+-------+
2092
- | ``%m `` | Month as a zero-padded | 01, 02, ..., 12 | |
2092
+ | ``%m `` | Month as a zero-padded | 01, 02, ..., 12 | \( 9) |
2093
2093
| | decimal number. | | |
2094
2094
+-----------+--------------------------------+------------------------+-------+
2095
- | ``%y `` | Year without century as a | 00, 01, ..., 99 | |
2095
+ | ``%y `` | Year without century as a | 00, 01, ..., 99 | \( 9) |
2096
2096
| | zero-padded decimal number. | | |
2097
2097
+-----------+--------------------------------+------------------------+-------+
2098
2098
| ``%Y `` | Year with century as a decimal | 0001, 0002, ..., 2013, | \( 2) |
2099
2099
| | number. | 2014, ..., 9998, 9999 | |
2100
2100
+-----------+--------------------------------+------------------------+-------+
2101
- | ``%H `` | Hour (24-hour clock) as a | 00, 01, ..., 23 | |
2101
+ | ``%H `` | Hour (24-hour clock) as a | 00, 01, ..., 23 | \( 9) |
2102
2102
| | zero-padded decimal number. | | |
2103
2103
+-----------+--------------------------------+------------------------+-------+
2104
- | ``%I `` | Hour (12-hour clock) as a | 01, 02, ..., 12 | |
2104
+ | ``%I `` | Hour (12-hour clock) as a | 01, 02, ..., 12 | \( 9) |
2105
2105
| | zero-padded decimal number. | | |
2106
2106
+-----------+--------------------------------+------------------------+-------+
2107
2107
| ``%p `` | Locale's equivalent of either || AM, PM (en_US); | \( 1), |
2108
2108
| | AM or PM. || am, pm (de_DE) | \( 3) |
2109
2109
+-----------+--------------------------------+------------------------+-------+
2110
- | ``%M `` | Minute as a zero-padded | 00, 01, ..., 59 | |
2110
+ | ``%M `` | Minute as a zero-padded | 00, 01, ..., 59 | \( 9) |
2111
2111
| | decimal number. | | |
2112
2112
+-----------+--------------------------------+------------------------+-------+
2113
- | ``%S `` | Second as a zero-padded | 00, 01, ..., 59 | \( 4) |
2114
- | | decimal number. | | |
2113
+ | ``%S `` | Second as a zero-padded | 00, 01, ..., 59 | \( 4), |
2114
+ | | decimal number. | | \( 9) |
2115
2115
+-----------+--------------------------------+------------------------+-------+
2116
2116
| ``%f `` | Microsecond as a decimal | 000000, 000001, ..., | \( 5) |
2117
2117
| | number, zero-padded on the | 999999 | |
@@ -2125,19 +2125,19 @@ format codes.
2125
2125
| ``%Z `` | Time zone name (empty string | (empty), UTC, EST, CST | |
2126
2126
| | if the object is naive). | | |
2127
2127
+-----------+--------------------------------+------------------------+-------+
2128
- | ``%j `` | Day of the year as a | 001, 002, ..., 366 | |
2128
+ | ``%j `` | Day of the year as a | 001, 002, ..., 366 | \( 9) |
2129
2129
| | zero-padded decimal number. | | |
2130
2130
+-----------+--------------------------------+------------------------+-------+
2131
- | ``%U `` | Week number of the year | 00, 01, ..., 53 | \( 7) |
2132
- | | (Sunday as the first day of | | |
2131
+ | ``%U `` | Week number of the year | 00, 01, ..., 53 | \( 7), |
2132
+ | | (Sunday as the first day of | | \( 9) |
2133
2133
| | the week) as a zero padded | | |
2134
2134
| | decimal number. All days in a | | |
2135
2135
| | new year preceding the first | | |
2136
2136
| | Sunday are considered to be in | | |
2137
2137
| | week 0. | | |
2138
2138
+-----------+--------------------------------+------------------------+-------+
2139
- | ``%W `` | Week number of the year | 00, 01, ..., 53 | \( 7) |
2140
- | | (Monday as the first day of | | |
2139
+ | ``%W `` | Week number of the year | 00, 01, ..., 53 | \( 7), |
2140
+ | | (Monday as the first day of | | \( 9) |
2141
2141
| | the week) as a decimal number. | | |
2142
2142
| | All days in a new year | | |
2143
2143
| | preceding the first Monday | | |
@@ -2177,8 +2177,8 @@ incomplete or ambiguous ISO 8601 directives will raise a :exc:`ValueError`.
2177
2177
| ``%u `` | ISO 8601 weekday as a decimal | 1, 2, ..., 7 | |
2178
2178
| | number where 1 is Monday. | | |
2179
2179
+-----------+--------------------------------+------------------------+-------+
2180
- | ``%V `` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \( 8) |
2181
- | | number with Monday as | | |
2180
+ | ``%V `` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \( 8), |
2181
+ | | number with Monday as | | \( 9) |
2182
2182
| | the first day of the week. | | |
2183
2183
| | Week 01 is the week containing | | |
2184
2184
| | Jan 4. | | |
@@ -2274,6 +2274,11 @@ Notes:
2274
2274
:meth: `strptime ` format string. Also note that ``%G `` and ``%Y `` are not
2275
2275
interchangeable.
2276
2276
2277
+ (9)
2278
+ When used with the :meth: `strptime ` method, the leading zero is optional
2279
+ for formats ``%d ``, ``%m ``, ``%H ``, ``%I ``, ``%M ``, ``%S ``, ``%J ``, ``%U ``,
2280
+ ``%W ``, and ``%V ``. Format ``%y `` does require a leading zero.
2281
+
2277
2282
.. rubric :: Footnotes
2278
2283
2279
2284
.. [# ] If, that is, we ignore the effects of Relativity
0 commit comments