]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-89762: Document strftime %G, %V, and %u format specifiers (GH-124572) ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 28 Oct 2024 22:01:18 +0000 (23:01 +0100)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2024 22:01:18 +0000 (22:01 +0000)
(cherry picked from commit 85799f1ffd5f285ef93a608b0aaf6acbb464ff9d)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
Doc/library/time.rst

index 188dbca8fd16918f9e287011ed5f24587e3490d3..5d6365f23fdc2b79910f734a7ddab945598ccdc3 100644 (file)
@@ -460,6 +460,9 @@ Functions
    |           |                                                |       |
    |           |                                                |       |
    +-----------+------------------------------------------------+-------+
+   | ``%u``    | Day of the week (Monday is 1; Sunday is 7)     |       |
+   |           | as a decimal number [1, 7].                    |       |
+   +-----------+------------------------------------------------+-------+
    | ``%w``    | Weekday as a decimal number [0(Sunday),6].     |       |
    |           |                                                |       |
    +-----------+------------------------------------------------+-------+
@@ -492,6 +495,16 @@ Functions
    | ``%Z``    | Time zone name (no characters if no time zone  |       |
    |           | exists). Deprecated. [1]_                      |       |
    +-----------+------------------------------------------------+-------+
+   | ``%G``    | ISO 8601 year (similar to ``%Y`` but follows   |       |
+   |           | the rules for the ISO 8601 calendar year).     |       |
+   |           | The year starts with the week that contains    |       |
+   |           | the first Thursday of the calendar year.       |       |
+   +-----------+------------------------------------------------+-------+
+   | ``%V``    | ISO 8601 week number (as a decimal number      |       |
+   |           | [01,53]). The first week of the year is the    |       |
+   |           | one that contains the first Thursday of the    |       |
+   |           | year. Weeks start on Monday.                   |       |
+   +-----------+------------------------------------------------+-------+
    | ``%%``    | A literal ``'%'`` character.                   |       |
    +-----------+------------------------------------------------+-------+