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... -- Regards, PhilK Email: phil@xfr.co.uk / Voicemail & Facsimile: 07092 070518 "Work as if you lived in the early days of a better nation." - Alasdair Gray
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
Hi Cameron, Thanks for the reply. J. Cameron Cooper wrote:
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 1970orso,dependingonsystem.
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.
I did some trial and error tinkering with the dB DA, and chose to use mxDateTime values - this has resolved the issue for now, but I'm painfully aware that it may cause issues elsewhere, so I'll investigate along the lines you suggest in more depth. I'm surprised that a Date of Birth would be outside the range considered normal! -- Regards, PhilK Email: phil@xfr.co.uk / Voicemail & Facsimile: 07092 070518 "Work as if you lived in the early days of a better nation." - Alasdair Gray
participants (2)
-
J. Cameron Cooper -
Philip Kilner