Serhiy Storchaka added the comment:

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.

----------

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

Reply via email to