[Zope] Date/Time formatting problem

J. Cameron Cooper zope-l at jcameroncooper.com
Thu Nov 4 14:33:32 EST 2004


Philip Kilner wrote:
> Hi List,
> 
> I'm getting: -
> 
> "The time -276134400.000000 is beyond the range of this Python 
> implementation."
> 
> When I use: -
> 
> <span tal:replace="python: RawDateTime.strftime('%d/%m/%Y')">Date</span>
> 
> My range of dates is from around 1924 to 2026. The data is from SQL 
> Server, and I'm using the egenix mxODBC DA.
> 
> Can anyone point me in the right direction to sort this out, please?
> 
> I'm a bit stumped because the range of dates is quite modest...
> 

Your early dates may run afoul of the system C library. From Python docs:

"""The functions in this module do not handle dates and times before the 
epoch or far in the future. The cut-off point in the future is 
determined by the C library; for Unix, it is typically in 2038."""

The epoch typically begins in 1980 or 1970 or so, depending on system.

Are your objects Python datetime.datetime objects? Or are they Zope 
DateTime object? You may have to build your dates using the 
methods/attributes available for individual components of the date/time.

         --jcc


More information about the Zope mailing list