We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef3ec1f commit 33d5109Copy full SHA for 33d5109
1 file changed
Misc/NEWS.d/next/Library/2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst
@@ -0,0 +1,9 @@
1
+Fix :meth:`datetime.datetime.strptime`, :meth:`datetime.date.strptime` as
2
+well as :func:`time.strptime` (by modifying :class:`_strptime.TimeRE`) to
3
+make ``%c`` and ``%y`` accept year number representations consisting of
4
+fewer digits than the usual four or two. Thanks to that, certain
5
+``strftime/strptime`` round trips (such as
6
+``datetime.strptime(dt.strftime("%c"), "%c"))`` for ``dt.year`` less than
7
+1000) no longer raise ``ValueError`` for some locales/platforms (this was
8
+the case, e.g., on Linux -- for various locales, including
9
+``C``/``C.UTF-8``).
0 commit comments