This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author akira
Recipients akira
Date 2014-08-21.11:35:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
>>> from datetime import datetime, timezone
  >>> dt =
  >>> fmt = '%Y-%m-%d %H:%M:%S.%f %Z%z'
  >>> datetime.strptime(dt.strftime(fmt), fmt)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/cpython/Lib/", line 500, in _strptime_datetime
      tt, fraction = _strptime(data_string, format)
    File "/cpython/Lib/", line 337, in _strptime
      (data_string, format))
  ValueError: time data '2014-08-21 11:29:13.537251 UTC+00:00+0000'
  does not match format '%Y-%m-%d %H:%M:%S.%f %Z%z'

The issue is that dt.strftime('%Z') produces 'UTC+00:00'
(due to timezone.utc.tzname(dt) returning 'UTC+00:00')
instead of 'UTC' that strptime() accepts and %Z examples [1]
in the docs demonstrate.

Date User Action Args
2014-08-21 11:35:17akirasetrecipients: + akira
2014-08-21 11:35:17akirasetmessageid: <>
2014-08-21 11:35:17akiralinkissue22241 messages
2014-08-21 11:35:16akiracreate