This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Please officially support %G, %V and %u directives in time library
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Raphael
Priority: normal Keywords:

Created on 2021-10-24 13:50 by Raphael, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg404933 - (view) Author: (Raphael) Date: 2021-10-24 13:50
In the time library documentation (https://docs.python.org/3/library/time.html) the directives %G, %V and %u for strftime() are missing, although they work (at least for me in Linux Mint):

$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from time import strftime
>>> strftime("%G-W%V-%u")
'2021-W42-7'

This seems to be officially supported by the datetime library since https://bugs.python.org/issue12006 or at least there is a section for the ISO 8601 week directives in the datetime documentation:
https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes

I would like to see the same for the time library.
History
Date User Action Args
2022-04-11 14:59:51adminsetgithub: 89762
2021-10-25 09:48:51Raphaelsettitle: Please official support %G, %V and %u directives in time library -> Please officially support %G, %V and %u directives in time library
2021-10-24 20:56:31rhettingersetversions: - Python 3.6, Python 3.7, Python 3.8, Python 3.9, Python 3.10
2021-10-24 13:50:42Raphaelcreate