mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix by Nick Russo in processing of timezone in test program; the
ParsedDate didn't have the correct day of week.
This commit is contained in:
parent
947a0fa4f9
commit
1d2b23ef22
1 changed files with 4 additions and 2 deletions
|
@ -927,9 +927,11 @@ if __name__ == '__main__':
|
||||||
print 'Subject:', m.getheader('subject')
|
print 'Subject:', m.getheader('subject')
|
||||||
print 'Date:', m.getheader('date')
|
print 'Date:', m.getheader('date')
|
||||||
date = m.getdate_tz('date')
|
date = m.getdate_tz('date')
|
||||||
|
tz = date[-1]
|
||||||
|
date = time.localtime(mktime_tz(date))
|
||||||
if date:
|
if date:
|
||||||
print 'ParsedDate:', time.asctime(date[:-1]),
|
print 'ParsedDate:', time.asctime(date),
|
||||||
hhmmss = date[-1]
|
hhmmss = tz
|
||||||
hhmm, ss = divmod(hhmmss, 60)
|
hhmm, ss = divmod(hhmmss, 60)
|
||||||
hh, mm = divmod(hhmm, 60)
|
hh, mm = divmod(hhmm, 60)
|
||||||
print "%+03d%02d" % (hh, mm),
|
print "%+03d%02d" % (hh, mm),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue