[Zope-Checkins] CVS: Packages/DateTime - DateTime.py:1.85.12.10

Martijn Pieters mj at zopatista.com
Fri Jun 25 11:43:36 EDT 2004


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

Modified Files:
      Tag: Zope-2_7-branch
	DateTime.py 
Log Message:
Collector #1386: Fixed ISO 1386 parsing, making the colon in the timezone
offset optional.


=== Packages/DateTime/DateTime.py 1.85.12.9 => 1.85.12.10 ===
--- Packages/DateTime/DateTime.py:1.85.12.9	Fri Jun 25 10:37:18 2004
+++ Packages/DateTime/DateTime.py	Fri Jun 25 11:43:06 2004
@@ -1696,11 +1696,11 @@
 
         datereg = re.compile('([0-9]{4})(-([0-9][0-9]))?(-([0-9][0-9]))?')
         timereg = re.compile('T([0-9]{2})(:([0-9][0-9]))?(:([0-9][0-9]))?(\.[0-9]{1,20})?')
-        zonereg = re.compile('([+-][0-9][0-9])(:([0-9][0-9]))')
+        zonereg = re.compile('([+-][0-9][0-9])(:?([0-9][0-9]))')
 
         # Date part
 
-        fields = datereg.split(s.strip())
+        fields = datereg.split(s.strip(), 1)
 
         if fields[1]:   year  = int(fields[1])
         if fields[3]:   month = int(fields[3])



More information about the Zope-Checkins mailing list