*Borrow* GNU docs wording

This commit is contained in:
Stan Ulbrych 2025-03-11 16:31:02 +00:00
parent c149570fb1
commit 998e4e8f3d

View file

@ -2465,6 +2465,11 @@ These methods accept format codes that can be used to parse and format dates::
>>> _.strftime('%a %d %b %Y, %I:%M%p')
'Mon 31 Jan 2022, 11:59PM'
The user has to make sure, though, that the input can be parsed in a unambiguous
way. The string ``2025112`` can be parsed using the format ``%Y%m%d`` as ``2025-1-12``,
``2025-11-2``, or even ``20251-1-2``. It is necessary to add appropriate separators to
reliably get results.
The following is a list of all the format codes that the 1989 C standard
requires, and these work on all platforms with a standard C implementation.
@ -2599,14 +2604,6 @@ method. The ISO 8601 year and ISO 8601 week directives are not interchangeable
with the year and week number directives above. Calling :meth:`~.datetime.strptime` with
incomplete or ambiguous ISO 8601 directives will raise a :exc:`ValueError`.
.. Note::
Input will be split to cope with the provided directives in the format string,
this aligns with the behaviour of the C implementation.::
>>> datetime.strptime('20250310T12','%Y%m%dT%H%M')
datetime.datetime(2025, 3, 10, 1, 2)
The full set of format codes supported varies across platforms, because Python
calls the platform C library's :c:func:`strftime` function, and platform
variations are common. To see the full set of format codes supported on your