@@ -2093,7 +2093,7 @@ format codes.
2093
2093
| | where 0 is Sunday and 6 is | | |
2094
2094
| | Saturday. | | |
2095
2095
+-----------+--------------------------------+------------------------+-------+
2096
- | ``%d `` | Day of the month as a | 01, 02, ..., 31 | |
2096
+ | ``%d `` | Day of the month as a | 01, 02, ..., 31 | \( 9) |
2097
2097
| | zero-padded decimal number. | | |
2098
2098
+-----------+--------------------------------+------------------------+-------+
2099
2099
| ``%b `` | Month as locale's abbreviated || Jan, Feb, ..., Dec | \( 1) |
@@ -2106,29 +2106,29 @@ format codes.
2106
2106
| | || Januar, Februar, ..., | |
2107
2107
| | | Dezember (de_DE) | |
2108
2108
+-----------+--------------------------------+------------------------+-------+
2109
- | ``%m `` | Month as a zero-padded | 01, 02, ..., 12 | |
2109
+ | ``%m `` | Month as a zero-padded | 01, 02, ..., 12 | \( 9) |
2110
2110
| | decimal number. | | |
2111
2111
+-----------+--------------------------------+------------------------+-------+
2112
- | ``%y `` | Year without century as a | 00, 01, ..., 99 | |
2112
+ | ``%y `` | Year without century as a | 00, 01, ..., 99 | \( 9) |
2113
2113
| | zero-padded decimal number. | | |
2114
2114
+-----------+--------------------------------+------------------------+-------+
2115
2115
| ``%Y `` | Year with century as a decimal | 0001, 0002, ..., 2013, | \( 2) |
2116
2116
| | number. | 2014, ..., 9998, 9999 | |
2117
2117
+-----------+--------------------------------+------------------------+-------+
2118
- | ``%H `` | Hour (24-hour clock) as a | 00, 01, ..., 23 | |
2118
+ | ``%H `` | Hour (24-hour clock) as a | 00, 01, ..., 23 | \( 9) |
2119
2119
| | zero-padded decimal number. | | |
2120
2120
+-----------+--------------------------------+------------------------+-------+
2121
- | ``%I `` | Hour (12-hour clock) as a | 01, 02, ..., 12 | |
2121
+ | ``%I `` | Hour (12-hour clock) as a | 01, 02, ..., 12 | \( 9) |
2122
2122
| | zero-padded decimal number. | | |
2123
2123
+-----------+--------------------------------+------------------------+-------+
2124
2124
| ``%p `` | Locale's equivalent of either || AM, PM (en_US); | \( 1), |
2125
2125
| | AM or PM. || am, pm (de_DE) | \( 3) |
2126
2126
+-----------+--------------------------------+------------------------+-------+
2127
- | ``%M `` | Minute as a zero-padded | 00, 01, ..., 59 | |
2127
+ | ``%M `` | Minute as a zero-padded | 00, 01, ..., 59 | \( 9) |
2128
2128
| | decimal number. | | |
2129
2129
+-----------+--------------------------------+------------------------+-------+
2130
- | ``%S `` | Second as a zero-padded | 00, 01, ..., 59 | \( 4) |
2131
- | | decimal number. | | |
2130
+ | ``%S `` | Second as a zero-padded | 00, 01, ..., 59 | \( 4), |
2131
+ | | decimal number. | | \( 9) |
2132
2132
+-----------+--------------------------------+------------------------+-------+
2133
2133
| ``%f `` | Microsecond as a decimal | 000000, 000001, ..., | \( 5) |
2134
2134
| | number, zero-padded on the | 999999 | |
@@ -2142,19 +2142,19 @@ format codes.
2142
2142
| ``%Z `` | Time zone name (empty string | (empty), UTC, EST, CST | |
2143
2143
| | if the object is naive). | | |
2144
2144
+-----------+--------------------------------+------------------------+-------+
2145
- | ``%j `` | Day of the year as a | 001, 002, ..., 366 | |
2145
+ | ``%j `` | Day of the year as a | 001, 002, ..., 366 | \( 9) |
2146
2146
| | zero-padded decimal number. | | |
2147
2147
+-----------+--------------------------------+------------------------+-------+
2148
- | ``%U `` | Week number of the year | 00, 01, ..., 53 | \( 7) |
2149
- | | (Sunday as the first day of | | |
2148
+ | ``%U `` | Week number of the year | 00, 01, ..., 53 | \( 7), |
2149
+ | | (Sunday as the first day of | | \( 9) |
2150
2150
| | the week) as a zero padded | | |
2151
2151
| | decimal number. All days in a | | |
2152
2152
| | new year preceding the first | | |
2153
2153
| | Sunday are considered to be in | | |
2154
2154
| | week 0. | | |
2155
2155
+-----------+--------------------------------+------------------------+-------+
2156
- | ``%W `` | Week number of the year | 00, 01, ..., 53 | \( 7) |
2157
- | | (Monday as the first day of | | |
2156
+ | ``%W `` | Week number of the year | 00, 01, ..., 53 | \( 7), |
2157
+ | | (Monday as the first day of | | \( 9) |
2158
2158
| | the week) as a decimal number. | | |
2159
2159
| | All days in a new year | | |
2160
2160
| | preceding the first Monday | | |
@@ -2194,8 +2194,8 @@ incomplete or ambiguous ISO 8601 directives will raise a :exc:`ValueError`.
2194
2194
| ``%u `` | ISO 8601 weekday as a decimal | 1, 2, ..., 7 | |
2195
2195
| | number where 1 is Monday. | | |
2196
2196
+-----------+--------------------------------+------------------------+-------+
2197
- | ``%V `` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \( 8) |
2198
- | | number with Monday as | | |
2197
+ | ``%V `` | ISO 8601 week as a decimal | 01, 02, ..., 53 | \( 8), |
2198
+ | | number with Monday as | | \( 9) |
2199
2199
| | the first day of the week. | | |
2200
2200
| | Week 01 is the week containing | | |
2201
2201
| | Jan 4. | | |
@@ -2291,6 +2291,11 @@ Notes:
2291
2291
:meth: `strptime ` format string. Also note that ``%G `` and ``%Y `` are not
2292
2292
interchangeable.
2293
2293
2294
+ (9)
2295
+ When used with the :meth: `strptime ` method, the leading zero is optional
2296
+ for formats ``%d ``, ``%m ``, ``%H ``, ``%I ``, ``%M ``, ``%S ``, ``%J ``, ``%U ``,
2297
+ ``%W ``, and ``%V ``. Format ``%y `` does require a leading zero.
2298
+
2294
2299
.. rubric :: Footnotes
2295
2300
2296
2301
.. [# ] If, that is, we ignore the effects of Relativity
0 commit comments