[issue34158] Documentation of datetime '%z' format code is odd
New submission from Christophe Nanteuil <christophe.nanteuil@gmail.com>: In § 8.1.8. "strftime() and strptime() Behavior", the documentation states that "%z" format code is a string of the form '±HHMM[SS[.uuuuuu]]' where uuuuuu is a 2-digit string giving the number of UTC offset microseconds. I think it's a 6-digit string. ---------- assignee: docs@python components: Documentation files: datetime.rst.patch keywords: patch messages: 321968 nosy: Christophe Nanteuil, docs@python priority: normal severity: normal status: open title: Documentation of datetime '%z' format code is odd versions: Python 3.7 Added file: https://bugs.python.org/file47704/datetime.rst.patch _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment: Added as part of 018d353c1c8c87767d2335cd884017c2ce12e045 and a fix regarding duplicate words for that part was added at bac2d5ba30339298db7d4caa9c8cd31d807cf081. Relevant format string at https://github.com/python/cpython/pull/2896/files#diff-25e2d173c84057d069b78.... Relevant test case with 6-digit string for microsecond : https://github.com/python/cpython/pull/2896/files#diff-acc40bec51c7de832de33.... Table at https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-beha... could also be updated with microseconds being optional in the second column %z | UTC offset in the form ±HHMM[SS] (empty string if the object is naive). | (empty), +0000, -0400, +1030 You can raise a GitHub PR for the same. Thanks ---------- nosy: +xtreak _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Change by Roundup Robot <devnull@psf.upfronthosting.co.za>: ---------- pull_requests: +7908 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Martin Panter <vadmium+py@gmail.com> added the comment: FWIW more oddities with this paragraph could be fixed by: * removing the first “and” from “HH is . . ., [and] MM is . . ., SS is . . . and uuuuuu is”, * changing the condition for omitting “uuuuuu” from “a whole number of [minutes]” to “seconds”, and * changing “the [SS parts are] omitted” to singular “SS part is”. ---------- nosy: +martin.panter _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Change by Paul Ganssle <p.ganssle@gmail.com>: ---------- nosy: +p-ganssle _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Christophe Nanteuil <christophe.nanteuil@gmail.com> added the comment: PR updated according to Martin Panter comments. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Alexander Belopolsky <alexander.belopolsky@gmail.com> added the comment: New changeset 92878829c31ab2fc71c60555ce87a5f6cbc876f0 by Alexander Belopolsky (Christophe Nanteuil) in branch 'master': bpo-34158: Documentation UTC offset update (GH-8377) https://github.com/python/cpython/commit/92878829c31ab2fc71c60555ce87a5f6cbc... ---------- nosy: +belopolsky _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +9118 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Ned Deily <nad@python.org> added the comment: New changeset 0991b9bb94036e0f271d223c8db7d81980c76736 by Ned Deily (Miss Islington (bot)) in branch '3.7': [3.7] bpo-34158: Documentation UTC offset update (GH-8377) (GH-9732) https://github.com/python/cpython/commit/0991b9bb94036e0f271d223c8db7d81980c... ---------- nosy: +ned.deily _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
Ned Deily <nad@python.org> added the comment: I assume this can now be closed. Thanks, everyone! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue34158> _______________________________________
participants (8)
-
Alexander Belopolsky
-
Christophe Nanteuil
-
Karthikeyan Singaravelan
-
Martin Panter
-
miss-islington
-
Ned Deily
-
Paul Ganssle
-
Roundup Robot