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 lilydjwg
Recipients lilydjwg
Date 2016-10-31.05:48:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477892937.56.0.524633393868.issue28565@psf.upfronthosting.co.za>
In-reply-to
Content
With %z, the result gets a tzinfo, but with %Z, it succeeds but the result is without timezone info:

>>> datetime.datetime.strptime('2016-10-31T03:58:24 CST', '%Y-%m-%dT%H:%M:%S %Z')
datetime.datetime(2016, 10, 31, 3, 58, 24)
>>> datetime.datetime.strptime('2016-10-31T03:58:24 +0800', '%Y-%m-%dT%H:%M:%S %z')
datetime.datetime(2016, 10, 31, 3, 58, 24, tzinfo=datetime.timezone(datetime.timedelta(0, 28800)))

So the first one loses infomation (and will result in wrong values if the programmer isn't aware of this, and the local timezone is different than the one in the string).
History
Date User Action Args
2016-10-31 05:48:57lilydjwgsetrecipients: + lilydjwg
2016-10-31 05:48:57lilydjwgsetmessageid: <1477892937.56.0.524633393868.issue28565@psf.upfronthosting.co.za>
2016-10-31 05:48:57lilydjwglinkissue28565 messages
2016-10-31 05:48:56lilydjwgcreate