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 Paul Pinterits
Recipients Paul Pinterits, martin.panter
Date 2017-04-02.21:42:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491169338.9.0.0300789819519.issue29964@psf.upfronthosting.co.za>
In-reply-to
Content
I see. You're right, it does make a difference.

However, this behaviour is quite unexpected. Perhaps I just didn't read the docs carefully enough, but it wasn't clear to me that the time module had such half-baked support for time zones.

An unsuspecting user, like me, reads the documentation on strptime, which directs you to strftime. There you read that %z is a supported directive. Along the way you've come across the conversion table, which tells you that mktime() can convert struct_time objects to timestamps. But then when you try to parse a time string, the information gets lost somewhere along the way:

>>> mktime(strptime("+0000", "%z")) == mktime(strptime("+0200", "%z"))
True

If you visit the section about struct_time objects, you find this footnote:
"Changed in version 3.3: tm_gmtoff and tm_zone attributes are available on platforms with C library supporting the corresponding fields in struct tm."

But even after reading that, I'd still expect the tm_gmtoff attribute to have some sort of effect and not get silently discarded.
History
Date User Action Args
2017-04-02 21:42:18Paul Pinteritssetrecipients: + Paul Pinterits, martin.panter
2017-04-02 21:42:18Paul Pinteritssetmessageid: <1491169338.9.0.0300789819519.issue29964@psf.upfronthosting.co.za>
2017-04-02 21:42:18Paul Pinteritslinkissue29964 messages
2017-04-02 21:42:18Paul Pinteritscreate