mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #6641: The datetime.strptime method now supports the %z directive.
This commit is contained in:
parent
f4112e2653
commit
ca94f55758
5 changed files with 101 additions and 74 deletions
|
@ -1760,3 +1760,10 @@ Notes:
|
|||
(5)
|
||||
For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
|
||||
``%z`` is replaced with the string ``'-0330'``.
|
||||
|
||||
.. versionadded:: 3.2
|
||||
|
||||
When the ``%z`` directive is provided to the :meth:`strptime`
|
||||
method, an aware :class:`datetime` object will be produced. The
|
||||
``tzinfo`` of the result will be set to a :class:`timezone`
|
||||
instance.
|
Loading…
Add table
Add a link
Reference in a new issue