Skip to content

Please officially support %G, %V and %u directives in time library #89762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Raphael mannequin opened this issue Oct 24, 2021 · 2 comments
Closed

Please officially support %G, %V and %u directives in time library #89762

Raphael mannequin opened this issue Oct 24, 2021 · 2 comments
Labels
3.11 only security fixes docs Documentation in the Doc dir

Comments

@Raphael
Copy link
Mannequin

Raphael mannequin commented Oct 24, 2021

BPO 45599

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-10-24.13:50:42.617>
labels = ['type-feature', 'library', '3.11']
title = 'Please officially support %G, %V and %u directives in time library'
updated_at = <Date 2021-10-25.09:48:51.632>
user = 'https://bugs.python.org/Raphael'

bugs.python.org fields:

activity = <Date 2021-10-25.09:48:51.632>
actor = 'Raphael'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-10-24.13:50:42.617>
creator = 'Raphael'
dependencies = []
files = []
hgrepos = []
issue_num = 45599
keywords = []
message_count = 1.0
messages = ['404933']
nosy_count = 1.0
nosy_names = ['Raphael']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue45599'
versions = ['Python 3.11']

Linked PRs

@Raphael
Copy link
Mannequin Author

Raphael mannequin commented Oct 24, 2021

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.

@Raphael Raphael mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Oct 24, 2021
@rhettinger rhettinger removed 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes labels Oct 24, 2021
@Raphael Raphael mannequin changed the title Please official support %G, %V and %u directives in time library Please officially support %G, %V and %u directives in time library Oct 25, 2021
@Raphael Raphael mannequin changed the title Please official support %G, %V and %u directives in time library Please officially support %G, %V and %u directives in time library Oct 25, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 28, 2024
…ythonGH-124572)

(cherry picked from commit 85799f1)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Oct 28, 2024
…ythonGH-124572)

(cherry picked from commit 85799f1)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
@erlend-aasland erlend-aasland added docs Documentation in the Doc dir and removed type-feature A feature request or enhancement stdlib Python modules in the Lib dir labels Oct 28, 2024
erlend-aasland pushed a commit that referenced this issue Oct 28, 2024
…H-124572) (#126094)

(cherry picked from commit 85799f1)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
erlend-aasland pushed a commit that referenced this issue Oct 28, 2024
…H-124572) (#126095)

(cherry picked from commit 85799f1)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
@erlend-aasland
Copy link
Contributor

Thanks for the report, @raphael, and thanks for the patch @rruuaanng. These format specifiers are now documented in the time stdlib docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes docs Documentation in the Doc dir
Projects
Archived in project
Development

No branches or pull requests

2 participants