Kaydet (Commit) cd45a369 authored tarafından Barry Warsaw's avatar Barry Warsaw

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.
üst fba64e1e
...@@ -130,7 +130,8 @@ def formatdate(timeval=None, localtime=0): ...@@ -130,7 +130,8 @@ def formatdate(timeval=None, localtime=0):
offset = time.altzone offset = time.altzone
else: else:
offset = time.timezone offset = time.timezone
zone = '%+03d%02d' % (offset / -3600, offset % 60) hours, minutes = divmod(offset, -3600)
zone = '%+03d%02d' % (hours, minutes / -60)
else: else:
now = time.gmtime(timeval) now = time.gmtime(timeval)
# Timezone offset is always -0000 # Timezone offset is always -0000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment