Message291043
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. |
|
Date |
User |
Action |
Args |
2017-04-02 21:42:18 | Paul Pinterits | set | recipients:
+ Paul Pinterits, martin.panter |
2017-04-02 21:42:18 | Paul Pinterits | set | messageid: <1491169338.9.0.0300789819519.issue29964@psf.upfronthosting.co.za> |
2017-04-02 21:42:18 | Paul Pinterits | link | issue29964 messages |
2017-04-02 21:42:18 | Paul Pinterits | create | |
|