[Zope-dev] Zope 2.1.6 DateTime bug: daylight saving time not handled -- with patch

Dieter Maurer dieter@handshake.de
Sun, 28 May 2000 18:49:53 +0200


--Multipart_Sun_May_28_18:49:48_2000-1
Content-Type: text/plain; charset=US-ASCII

The Zope 2.1.6 DateTime module does not recognize daylight saving time.

Patch attached.

Dieter

--Multipart_Sun_May_28_18:49:48_2000-1
Content-Type: application/x-patch
Content-Disposition: attachment; filename="DateTime.pat"
Content-Transfer-Encoding: 8bit

--- lib/python/DateTime/:DateTime.py	Tue Mar 14 18:04:59 2000
+++ lib/python/DateTime/DateTime.py	Sun May 28 18:43:28 2000
@@ -94,6 +94,8 @@
 from types import InstanceType,IntType,FloatType,StringType
 try: from time import tzname
 except: tzname=('UNKNOWN','UNKNOWN')
+try: from time import daylight; tzname_index= daylight; del daylight
+except: tzname_index= 0
 
 
 
@@ -687,7 +689,7 @@
                   'saturday': 7,  'sat': 7}
 
 
-    try: _localzone=_cache._zmap[lower(tzname[0])]
+    try: _localzone=_cache._zmap[lower(tzname[tzname_index])]
     except:
         try:
             t=time()

--Multipart_Sun_May_28_18:49:48_2000-1--