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

Jim Fulton jim@zope.com
Mon, 14 Jan 2002 15:46:10 -0500


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

Modified Files:
	DateTime.py 
Log Message:
The DateTime module was changed to no longer import the string module,
but one of the uses of string.atoi wasn't fixed.  There also wasn't a
test for this. :(

Fixed bug in handling numneric time-zone offsets. We need to subtract,
rather than add the offset, since the offset is the offset of the
local time from UT, not the other way around.


=== Zope/lib/python/DateTime/DateTime.py 1.73 => 1.74 ===
 jd1901 =2415385L
 
-
 numericTimeZoneMatch=re.compile(r'[+-][0-9][0-9][0-9][0-9]').match #TS
 
-
-
 class _timezone:
     def __init__(self,data):
         self.name,self.timect,self.typect, \
@@ -364,7 +361,7 @@
         return DateTime._tzinfo[tz].info(t)[0]
     except:
         if numericTimeZoneMatch(tz) is not None:
-            return atoi(tz[1:3])*3600+atoi(tz[3:5])*60
+            return -int(tz[1:3])*3600-int(tz[3:5])*60
         else:
             return 0 # ??
 
@@ -918,6 +915,7 @@
                 # Check for and skip day of week:
                 if DayOfWeekNames.has_key(s):
                     continue
+                    
             raise self.SyntaxError, st
 
         day=None