From: Barry Warsaw Date: Mon, 19 Nov 2001 16:28:07 +0000 (+0000) Subject: formatdate(): The calculation of the minutes part of the zone was X-Git-Tag: v2.2.1c1~722 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd45a36959f3a8a74731c7dc25fee95108198e7d;p=python formatdate(): The calculation of the minutes part of the zone was incorrect for "uneven" timezones. This algorithm should work for even timezones (e.g. America/New_York) and uneven timezones (e.g. Australia/Adelaide and America/St_Johns). Closes SF bug #483231. --- diff --git a/Lib/email/Utils.py b/Lib/email/Utils.py index 58fd8da6bb..8d46096fdf 100644 --- a/Lib/email/Utils.py +++ b/Lib/email/Utils.py @@ -130,7 +130,8 @@ def formatdate(timeval=None, localtime=0): offset = time.altzone else: offset = time.timezone - zone = '%+03d%02d' % (offset / -3600, offset % 60) + hours, minutes = divmod(offset, -3600) + zone = '%+03d%02d' % (hours, minutes / -60) else: now = time.gmtime(timeval) # Timezone offset is always -0000