[Zope-Checkins] CVS: Zope/lib/python/DateTime - DateTime.py:1.83.10.1
Lennart Regebro
lennart@torped.se
Thu, 16 Jan 2003 11:29:59 -0500
Update of /cvs-repository/Zope/lib/python/DateTime
In directory cvs.zope.org:/tmp/cvs-serv13693/lib/python/DateTime
Modified Files:
Tag: regebro-collector_740-branch
DateTime.py
Log Message:
#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.83 => 1.83.10.1 ===
--- Zope/lib/python/DateTime/DateTime.py:1.83 Fri Dec 13 07:33:57 2002
+++ Zope/lib/python/DateTime/DateTime.py Thu Jan 16 11:29:56 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 # ??
@@ -1293,6 +1293,10 @@
def timezone(self):
"""Return the timezone in which the object is represented."""
return self._tz
+
+ def tzoffset(self):
+ """Return the timezone in which the object is represented."""
+ return _tzoffset(self._tz, self._t)
def year(self):
"""Return the calendar year of the object"""