Re: #203: Timestamps "BC" raise "ValueError: second must be in 0..59"

Tim Roberts <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
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, [email protected]
Providenza & Boekelheide, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.