Paul Pinterits added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29964>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to