[Zope-Checkins] CVS: Zope/lib/python/DateTime - DateTime.py:1.79.6.4

seb seb@jamkit.com
Thu, 28 Nov 2002 07:11:49 -0500


Update of /cvs-repository/Zope/lib/python/DateTime
In directory cvs.zope.org:/tmp/cvs-serv27205/lib/python/DateTime

Modified Files:
      Tag: Zope-2_6-branch
	DateTime.py 
Log Message:
 - Collector #702: DateTime.rfc822() fails without daylight saving


=== Zope/lib/python/DateTime/DateTime.py 1.79.6.3 => 1.79.6.4 ===
--- Zope/lib/python/DateTime/DateTime.py:1.79.6.3	Tue Oct 29 13:13:11 2002
+++ Zope/lib/python/DateTime/DateTime.py	Thu Nov 28 07:11:47 2002
@@ -362,10 +362,6 @@
     return int(yr),int(mo),int(dy)
 
 def _tzoffset(tz, t):
-    """Returns the offset in seconds to GMT from a specific timezone (tz) at 
-    a specific time (t).  NB! The _tzoffset result is the same same sign as 
-    the time zone, i.e. GMT+2 has a 7200 second offset. This is the opposite 
-    sign of time.timezone which (confusingly) is -7200 for GMT+2."""
     try:
         return DateTime._tzinfo[tz].info(t)[0]
     except:
@@ -404,10 +400,7 @@
     return rval
 
 def _tzoffset2rfc822zone(seconds):
-    """Takes an offset, such as from _tzoffset(), and returns an rfc822 
-       compliant zone specification. Please note that the result of 
-       _tzoffset() is the negative of what time.localzone and time.altzone is."""
-    return "%+03d%02d" % divmod( (seconds/60), 60) 
+    return "%+03d%02d" % divmod( (-seconds/60), 60) 
 
 
 class DateTime:
@@ -1449,7 +1442,6 @@
         return '%s, %2.2d %s %d %2.2d:%2.2d:%2.2d %s' % (
             self._aday,self._day,self._amon,self._year,
             self._hour,self._minute,self._nearsec,tzoffset)
-
 
     # New formats
     def fCommon(self):