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

Lennart Regebro lennart@torped.se
Thu, 16 Jan 2003 11:53:52 -0500


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

Modified Files:
      Tag: Zope-2_6-branch
	DateTime.py 
Log Message:
Merge with 2.6
#740: _tzoffset handled positive numerical offsets incorrectly. This has been fixed. A large set of tests for different cases has been added, and for the purpose of those tests DateTime has a new feature: A tzoffset() method.

=== Zope/lib/python/DateTime/DateTime.py 1.79.6.5 => 1.79.6.6 ===
--- Zope/lib/python/DateTime/DateTime.py:1.79.6.5	Thu Nov 28 09:35:27 2002
+++ Zope/lib/python/DateTime/DateTime.py	Thu Jan 16 11:53:19 2003
@@ -370,7 +370,7 @@
         return DateTime._tzinfo[tz].info(t)[0]
     except:
         if numericTimeZoneMatch(tz) is not None:
-            return -int(tz[1:3])*3600-int(tz[3:5])*60
+            return int(tz[0:3])*3600+int(tz[0]+tz[3:5])*60
         else:
             return 0 # ??
 
@@ -1292,6 +1292,10 @@
     def timezone(self):
         """Return the timezone in which the object is represented."""
         return self._tz
+
+    def tzoffset(self):
+        """Return the timezone offset for the objects timezone."""
+        return _tzoffset(self._tz, self._t)
 
     def year(self):
         """Return the calendar year of the object"""