Message249413
The C code produces correct values according to the tz database.
If TZ=Europe/Moscow then
tzname={"MSK", "MSD"} at 2010-07-01 and
tzname={"MSK", "MSK"} at 2015-07-01. Notice the difference!
The code calls C mktime() with corresponding time tuples
and checks that *tzname* is equal to the expected values. That's all.
If C code is incomprehensible; here's its Python analog:
>>> import os
>>> os.environ['TZ'] = 'Europe/Moscow'
>>> import time
>>> time.tzset()
>>> time.mktime((2010,7,1,0,0,0,-1,-1,-1))
1277928000.0
>>> time.tzname #XXX expected ('MSK', 'MSD')
('MSK', 'MSK')
>>> time.mktime((2015,7,1,0,0,0,-1,-1,-1))
1435698000.0
>>> time.tzname
('MSK', 'MSK')
C tzname changes on my machine after the corresponding C mktime() calls
but Python time.tzname does not change after the time.mktime() calls. |
|
Date |
User |
Action |
Args |
2015-08-31 16:47:59 | akira | set | recipients:
+ akira, belopolsky, pitrou |
2015-08-31 16:47:59 | akira | set | messageid: <1441039679.61.0.146704205121.issue22798@psf.upfronthosting.co.za> |
2015-08-31 16:47:59 | akira | link | issue22798 messages |
2015-08-31 16:47:59 | akira | create | |
|