[Python-bugs-list] [ python-Bugs-483231 ] email.Utils.formatdate(): localtime bug

noreply@sourceforge.net noreply@sourceforge.net
Sun, 18 Nov 2001 18:33:44 -0800


Bugs item #483231, was opened at 2001-11-18 18:33
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=483231&group_id=5470

Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason R. Mastaler (jasonrm)
Assigned to: Nobody/Anonymous (nobody)
Summary: email.Utils.formatdate(): localtime bug

Initial Comment:
email.Utils.formatdate(localtime=1) does 
not produce a correct UTC offset for 
"uneven" timezones (e.g, "+1030", "+0530")
In those cases, it rounds the offset down
to "+1000", and "+0500".

In the example below, you can see that
python produces the wrong UTC offset
once I set my TZ to "Australia/Adelaide",
a timezone whose offset should be "+1030".

$ date
Sun Nov 18 19:29:22 MST 2001
$ python2.2 -c 'import email;print 
email.Utils.formatdate(localtime=1)'
Sun, 18 Nov 2001 19:29:22 -0700

$ export TZ="Australia/Adelaide"
$ date
Mon Nov 19 12:59:35 CST 2001
$ python2.2 -c 'import email;print 
email.Utils.formatdate(localtime=1)'
Mon, 19 Nov 2001 12:59:35 +1000




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

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