[ZCM] [ZC] 1780/ 2 Resolve "DateTime.strftime raises TimeError for dates <= 1900 or >= 2038"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Wed May 18 11:20:51 EDT 2005


Issue #1780 Update (Resolve) "DateTime.strftime raises TimeError for dates <= 1900 or >= 2038"
 Status Resolved, Zope/bug+solution medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1780

==============================================================
= Resolve - Entry #2 by ajung on May 18, 2005 11:20 am

 Status: Pending => Resolved

Patch applied for Zope 2.8b2.
________________________________________
= Request - Entry #1 by scamps on May 13, 2005 4:33 am


Uploaded:  "DateTime.bin"
 - http://www.zope.org/Collectors/Zope/1780/DateTime.bin/view
Its known that using strftime method of DateTime module with dates <= 1900 or >= 2038, a TimeError is raised (in 32 bits architectures).   For instance:

>> d = DateTime('2045/30/01')
>> d.strftime('%d/%m/%Y')
DateTime.DateTime.TimeError: The time 2369343600.000000 is beyond the range of this Python implementation

At least is possible to fix the problem in strftime method using datetime module, new in python 2.3.   I attach a patch that works for me, with two additional unittests, and passing all previous unittests defined for the module.   Hope this can be commited. 
==============================================================



More information about the Zope-Collector-Monitor mailing list