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

2000-05-28 Thread Steve Alexander

Dieter Maurer wrote:
> 
> The Zope 2.1.6 DateTime module does not recognize daylight saving time.

You might find Shane Hathaway's revision of DateTime.py useful.

  http://www.zope.org/Members/hathawsh/DateTime.py

It corrects many rounding errors, as well as the problems with daylight
saving time.

I believe it is the version that will be in Zope 2.2

--
Steve Alexander
Software Engineer
Cat-Box limited

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




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

2000-05-28 Thread Dieter Maurer

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

Patch attached.

Dieter


--- 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()