Skip to content

Commit f499dee

Browse files
committed
Accept suggestions from @StanFromIreland
1 parent ed63eed commit f499dee

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Doc/library/datetime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,7 @@ differences between platforms in handling of unsupported format specifiers.
26312631
.. versionadded:: 3.12
26322632
``%:z`` was added for :meth:`~.datetime.strftime`
26332633

2634-
.. versionadded:: 3.15
2634+
.. versionadded:: next
26352635
``%:z`` was added for :meth:`~.datetime.strptime`
26362636

26372637
Technical Detail

Lib/test/test_strptime.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,6 @@ def test_offset(self):
406406
(*_, offset), _, offset_fraction = _strptime._strptime("-013030.000001", "%z")
407407
self.assertEqual(offset, -(one_hour + half_hour + half_minute))
408408
self.assertEqual(offset_fraction, -1)
409-
(*_, offset), _, offset_fraction = _strptime._strptime("Z", "%z")
410-
self.assertEqual(offset, 0)
411-
self.assertEqual(offset_fraction, 0)
412409
for directive in ("%z", "%:z"):
413410
(*_, offset), _, offset_fraction = _strptime._strptime("+01:00",
414411
directive)
@@ -430,6 +427,10 @@ def test_offset(self):
430427
directive)
431428
self.assertEqual(offset, one_hour + half_hour + half_minute)
432429
self.assertEqual(offset_fraction, 1000)
430+
(*_, offset), _, offset_fraction = _strptime._strptime("Z",
431+
directive)
432+
self.assertEqual(offset, 0)
433+
self.assertEqual(offset_fraction, 0)
433434

434435
def test_bad_offset(self):
435436
for directive in ("%z", "%:z"):
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
Support ``%:z`` directive for :meth:`~datetime.datetime.strptime` and
2-
:meth:`~datetime.time.strptime`. Patch by Lucas Esposito and Semyon Moroz.
1+
Support ``%:z`` directive for :meth:`datetime.datetime.strptime`,
2+
:meth:`datetime.time.strptime` and :meth:`time.strptime`.
3+
Patch by Lucas Esposito and Semyon Moroz.

0 commit comments

Comments
 (0)