[Python-checkins] Update documentation in datetime module strftime-and-strptime-behavior fix typo in '%W' format code description (GH-30232) (GH-30703)

vstinner webhook-mailer at python.org
Sat Jan 22 19:59:45 EST 2022


https://github.com/python/cpython/commit/d0852c447aae650b665aaad61d914a1dc4d7ad96
commit: d0852c447aae650b665aaad61d914a1dc4d7ad96
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: vstinner <vstinner at python.org>
date: 2022-01-23T01:59:41+01:00
summary:

Update documentation in datetime module strftime-and-strptime-behavior fix typo in '%W' format code description (GH-30232) (GH-30703)

A small change to the documentation of datetime module , in the format codes section of stftime and strptime. Changed the description of format code '%W' from 'as a decimal number' to 'a zero padded   decimal number' so it's in line with the example having leading zeros.  Similar to the format code '%U' above.

Automerge-Triggered-By: GH:pganssle
(cherry picked from commit d45cd2d20770f72a000ba6dfa9ac88dd49423c27)

Co-authored-by: Evan <binary-signal at users.noreply.github.com>

Co-authored-by: Evan <binary-signal at users.noreply.github.com>

files:
M Doc/library/datetime.rst

diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index 217cdf222b89b..f447b7bc9491e 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -2375,7 +2375,7 @@ requires, and these work on all platforms with a standard C implementation.
 +-----------+--------------------------------+------------------------+-------+
 | ``%U``    | Week number of the year        | 00, 01, ..., 53        | \(7), |
 |           | (Sunday as the first day of    |                        | \(9)  |
-|           | the week) as a zero padded     |                        |       |
+|           | the week) as a zero-padded     |                        |       |
 |           | decimal number. All days in a  |                        |       |
 |           | new year preceding the first   |                        |       |
 |           | Sunday are considered to be in |                        |       |
@@ -2383,10 +2383,10 @@ requires, and these work on all platforms with a standard C implementation.
 +-----------+--------------------------------+------------------------+-------+
 | ``%W``    | Week number of the year        | 00, 01, ..., 53        | \(7), |
 |           | (Monday as the first day of    |                        | \(9)  |
-|           | the week) as a decimal number. |                        |       |
-|           | All days in a new year         |                        |       |
-|           | preceding the first Monday     |                        |       |
-|           | are considered to be in        |                        |       |
+|           | the week) as a zero-padded     |                        |       |
+|           | decimal number. All days in a  |                        |       |
+|           | new year preceding the first   |                        |       |
+|           | Monday are considered to be in |                        |       |
 |           | week 0.                        |                        |       |
 +-----------+--------------------------------+------------------------+-------+
 | ``%c``    | Locale's appropriate date and  || Tue Aug 16 21:30:00   | \(1)  |



More information about the Python-checkins mailing list