Issue #6641: The datetime.strptime method now supports the %z directive.

This commit is contained in:
Alexander Belopolsky 2010-06-17 18:30:34 +00:00
parent f4112e2653
commit ca94f55758
5 changed files with 101 additions and 74 deletions

View file

@ -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.