[New-bugs-announce] [issue10678] email.utils.mktime_tz Giving wrong result , by ignoring Timezone that comes from value of parsedate .

Phyo Arkar Lwin report at bugs.python.org
Sat Dec 11 12:44:30 CET 2010


New submission from Phyo Arkar Lwin <phyo.arkarlwin at gmail.com>:

DESCRIPTION:

I am trying to parse Time Zone information out of email messages and i found out that mktime_tz is totally ignoring TimeZone information from parsedate_tz.


VERSION: 2.6.5
CODE and RESULTS:


from time import mktime
from email.utils import parsedate,parsedate_tz,formatdate,mktime_tz

parsedate_tz('Sat, 10 Apr 2004 03:50:19 +400')
>>> (2004, 4, 10, 3, 50, 19, 0, 1, -1, 14400)


mktime_tz(parsedate_tz('Sat, 10 Apr 2004 03:50:19 +400'))
>>>1081554619.0
mktime(parsedate('Sat, 10 Apr 2004 03:50:19'))
>>>1081545619.0

Same????

formatdate(mktime_tz(parsedate_tz('Sat, 10 Apr 2004 03:50:19 +400')))
>>>'Fri, 09 Apr 2004 23:50:19 -0000' # WRONG TOTALLY

Expected Result:
>>>'Sat, 10 Apr 2004 03:50:19 +400'

----------
components: None
messages: 123783
nosy: Phyo.Arkar.Lwin
priority: normal
severity: normal
status: open
title: email.utils.mktime_tz Giving wrong result , by ignoring Timezone  that comes from value of  parsedate .
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10678>
_______________________________________


More information about the New-bugs-announce mailing list