This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: time.timezone / time.strftime('%z') problem
Type: Stage:
Components: None Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, si_lan
Priority: normal Keywords:

Created on 2006-03-27 21:47 by si_lan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg27903 - (view) Author: Simon Lanzmich (si_lan) Date: 2006-03-27 21:47
The information returned by time.timezone and
time.strftime('%z') are different!

I get the following results:

[simon@simon ~]$ date +%z
+0200
[simon@simon ~]$ date +%Z
CEST
[simon@simon ~]$ python
Python 2.4.2 (#1, Feb 12 2006, 03:45:41)
[GCC 4.1.0 20060210 (Red Hat 4.1.0-0.24)] on linux2
 [...]
>>> time.timezone
-3600
>>> time.strftime('%z')
'+0200'

Please correct me if I'm wrong, but shouldn't
"time.timezone" return -7200 ?
msg27904 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-03-27 22:13
Logged In: YES 
user_id=849994

time.timezone is documented to return the offset for the
current non-DST timezone. Your timezone is CEST, which is
CET (+0100) plus DST, which is indicated by time.daylight
being nonzero.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43101
2006-03-27 21:47:18si_lancreate