Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Docs edit
  • Loading branch information
zuo committed Oct 1, 2024
commit a77c3da0f74f4f9372d85b39b8c5f8bc2cf7502d
10 changes: 5 additions & 5 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2639,11 +2639,11 @@ Notes:
or ``%x`` format code, no longer requires the *year* part of the
input to be zero-padded to the usual width (which is either 4 or
2 digits, depending on the format code and current locale). In
previous versions, a :exc:`ValueError` was raised if a shorter
*year* (not zero-padded to the 2- or 4-digit width as appropriate)
was part of the input. It is worth noting that, depending on the
platform/locale, such inputs may be produced by using
:meth:`~.datetime.strftime` with ``%c`` or ``%x``).
previous versions, a :exc:`ValueError` was raised if a narrower
(i.e., not zero-padded) year representation was part of the input
(and it is worth noting that, depending on the platform/locale,
such inputs may be produced by using :meth:`~.datetime.strftime`
with ``%c`` or ``%x``).

(2)
The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] range, but
Expand Down