Message255842
If call time.localtime() with time before 1990-03-25T03:00, EET is turned to MSK. I guess this is a time when the Europe/Kiev timezone was introduced.
>>> import os, time
>>> os.environ['TZ'] = 'Europe/Kiev'
>>> time.tzset()
>>> time.localtime(638319599)
time.struct_time(tm_year=1990, tm_mon=3, tm_mday=25, tm_hour=1, tm_min=59, tm_sec=59, tm_wday=6, tm_yday=84, tm_isdst=0)
>>> time.strftime('%Z', time.gmtime())
'MSK'
>>> time.localtime(638319600)
time.struct_time(tm_year=1990, tm_mon=3, tm_mday=25, tm_hour=3, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=84, tm_isdst=1)
>>> time.strftime('%Z', time.gmtime())
'EET'
C function localtime() implicitly calls tzset() and sets global C variables tzname, timezone, and daylight, but these changes are not exposed as variables in the time module. C and Python ideas about timezone becomes different. This looks as a bug in time.localtime() and other functions that implicitly change timezone variables. |
|
Date |
User |
Action |
Args |
2015-12-03 21:40:04 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, belopolsky, pitrou |
2015-12-03 21:40:04 | serhiy.storchaka | set | messageid: <1449178804.41.0.83393373991.issue22067@psf.upfronthosting.co.za> |
2015-12-03 21:40:04 | serhiy.storchaka | link | issue22067 messages |
2015-12-03 21:40:03 | serhiy.storchaka | create | |
|