Commit 4ec427b0 authored by Miss Islington (bot)'s avatar Miss Islington (bot) Committed by GitHub

bpo-27741: Better wording for datetime.strptime() (GH-9994)

(cherry picked from commit c0799ec9)
Co-authored-by: default avatarGus Goulart <augusto@goulart.me>
parent d61f586d
......@@ -1594,7 +1594,9 @@ although not all objects support a :meth:`timetuple` method.
Conversely, the :meth:`datetime.strptime` class method creates a
:class:`.datetime` object from a string representing a date and time and a
corresponding format string. ``datetime.strptime(date_string, format)`` is
equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``.
equivalent to ``datetime(*(time.strptime(date_string, format)[0:6]))``, except
when the format includes sub-second components or timezone offset information,
which are supported in ``datetime.strptime`` but are discarded by ``time.strptime``.
For :class:`.time` objects, the format codes for year, month, and day should not
be used, as time objects have no such values. If they're used anyway, ``1900``
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment