[Psycopg] #203: Timestamps "BC" raise "ValueError: second must be in 0..59"
Tim Roberts
timr at probo.com
Fri Jan 11 19:18:57 CET 2008
psycopg wrote:
> #203: Timestamps "BC" raise "ValueError: second must be in 0..59"
> -----------------------+----------------------------------------------------
> Reporter: hdiogenes | Owner: fog
> Type: defect | Status: new
> Priority: normal | Milestone: PSYCOPG 2.0.6
> Component: psycopg2 | Version: 2.0.2
> Severity: normal | Resolution:
> Keywords: |
> -----------------------+----------------------------------------------------
> Comment (by jamesh):
>
> The Python datetime type does not seem to support BC dates:
>
That is absolutely correct, as the documentation of the datetime module
says:
>>> import datetime
>>> datetime.date.max
datetime.date(9999, 12, 31)
>>> datetime.date.min
datetime.date(1, 1, 1)
>>>
> So it isn't just a simple matter of adding code to interpret the "BC"
> suffix.
And do what with it? As long as psycopg uses the Python datetime
module, there is no way for it to represent dates outside of the range
of the datetime type. Even if it interpreted the BC, it couldn't use it.
The eGenix mxDateTime module can handle dates from 5.8 million BC to 5.8
million AD, and I thought psycopg2 had an option to use mxDateTime as
its date type. (psycopg1 used mxDateTime exclusively.)
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Psycopg
mailing list