I’m wondering whether this is expected:

Python 3.3.2 (default, May 21 2013, 11:50:47) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.strftime("%F %T %z", time.gmtime(40 * 365 * 86400))
'2009-12-22 00:00:00 +0100‘

According to the documentation of time.gmtime(), it returns a struct_time in 
UTC, but %z is replaced by +0100, which is the UTC offset of my OS’s time zone 
without DST, but DST is currently in effect here (but was not at the timestamp 
passed to gmtime()).

40 * 365 * 86400 seconds is a bit less than 40 Years. I’m using a date near to 
today to rule out any peculiarities with dates that are long in the past. Using 
a date at which DST was active yields the same result:

>>> time.strftime("%F %T %z", time.gmtime(40.5 * 365 * 86400))
'2010-06-22 12:00:00 +0100'

Why is my OS’s time zone used for formatting a struct_time with the UTC time 
zone? I’m running OS X 10.8.4, my OS’s time zone is set to CET/CEST.

Regards
Michael

Attachment: smime.p7s
Description: S/MIME cryptographic signature

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to