[Python-checkins] CVS: python/dist/src/Lib/email Utils.py,1.6,1.7

Barry Warsaw bwarsaw@users.sourceforge.net
Mon, 19 Nov 2001 08:28:09 -0800


Update of /cvsroot/python/python/dist/src/Lib/email
In directory usw-pr-cvs1:/tmp/cvs-serv2163

Modified Files:
	Utils.py 
Log Message:
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.


Index: Utils.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Utils.py	2001/11/09 17:45:48	1.6
--- Utils.py	2001/11/19 16:28:07	1.7
***************
*** 131,135 ****
          else:
              offset = time.timezone
!         zone = '%+03d%02d' % (offset / -3600, offset % 60)
      else:
          now = time.gmtime(timeval)
--- 131,136 ----
          else:
              offset = time.timezone
!         hours, minutes = divmod(offset, -3600)
!         zone = '%+03d%02d' % (hours, minutes / -60)
      else:
          now = time.gmtime(timeval)