Message249413
| Author |
akira |
| Recipients |
akira, belopolsky, pitrou |
| Date |
2015年08月31日.16:47:59 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1441039679.61.0.146704205121.issue22798@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|