[ python-Bugs-1053539 ] time module returns wrong timezone under windows

SourceForge.net noreply at sourceforge.net
Mon Oct 25 15:26:53 CEST 2004


Bugs item #1053539, was opened at 2004-10-25 06:41
Message generated for change (Comment added) made by panjunyong
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1053539&group_id=5470

Category: Python Library
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: panjunyong (panjunyong)
Assigned to: Nobody/Anonymous (nobody)
Summary: time module returns wrong timezone under windows

Initial Comment:
I have tested windows xp/2000 Chinese version with
python 2.3.3 and python 2.4b1.  

My timezone in windows is GMT+8. But:

>>> import time
>>> time.timezone
-28800 

-28800 means GMT-8, but not GMT+8. This cause
time.time() time.gmtime() return wrong values(16 hours
late).

I have no such problem under linux.

BTW, I found the issue:

https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1039270&group_id=5470


So I think maybe this problem is sensitive with my
Chinese platform too:

>>> time.tzname
('\xd6\xd0\xb9\xfa\xb1\xea\xd7\xbc\xca\xb1\xbc\xe4',
'\xd6\xd0\xb9\xfa\xb1\xea\x
d7\xbc\xca\xb1\xbc\xe4')


----------------------------------------------------------------------

>Comment By: panjunyong (panjunyong)
Date: 2004-10-25 13:26

Message:
Logged In: YES 
user_id=601368

I am sure with my windows timezone setting. The time.tzname
is Chinese, which means 'Chinese Standard Time'. And China
is in GMT+8 zone.

Everything is ok under linux:

>>> import time
>>> time.tzname
('GMT+8', 'GMT+8')
>>> time.timezone
28800


----------------------------------------------------------------------

Comment By: George Yoshida (quiver)
Date: 2004-10-25 13:01

Message:
Logged In: YES 
user_id=671362

> -28800 means GMT-8
No, look at the doc more carefully.
  www.python.org/doc/current/lib/module-time.html
  negative in most of Western Europe, positive in the US, zero 
in the UK
If I remember correctly, China is on the opposite side of the 
world from the US. :-)

> time.time() time.gmtime() return wrong values(16 hours
> late).
Reverify the time-zone with your Windows machine.

BTW, "Most-of-Western-Europe" doesn't seem clear to me at 
all.
What's wrong with:
"negative in Asia, positive in the US, zero in the UK."

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1053539&group_id=5470


More information about the Python-bugs-list mailing list