summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-01-17 14:11:04 (GMT)
committerGuido van Rossum <guido@python.org>2000-01-17 14:11:04 (GMT)
commit1d2b23ef22856ae90a2947ab29ebfbf6f83f134a (patch)
treee4830e8fbc45d1bc6495cce7deb66d95ee095d32
parent947a0fa4f9f7dd559b59376e2847733781af3dd1 (diff)
downloadcpython-1d2b23ef22856ae90a2947ab29ebfbf6f83f134a.zip
cpython-1d2b23ef22856ae90a2947ab29ebfbf6f83f134a.tar.gz
cpython-1d2b23ef22856ae90a2947ab29ebfbf6f83f134a.tar.bz2
Fix by Nick Russo in processing of timezone in test program; the
ParsedDate didn't have the correct day of week.
-rw-r--r--Lib/rfc822.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index a147155..b937038 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -927,9 +927,11 @@ if __name__ == '__main__':
print 'Subject:', m.getheader('subject')
print 'Date:', m.getheader('date')
date = m.getdate_tz('date')
+ tz = date[-1]
+ date = time.localtime(mktime_tz(date))
if date:
- print 'ParsedDate:', time.asctime(date[:-1]),
- hhmmss = date[-1]
+ print 'ParsedDate:', time.asctime(date),
+ hhmmss = tz
hhmm, ss = divmod(hhmmss, 60)
hh, mm = divmod(hhmm, 60)
print "%+03d%02d" % (hh, mm),