Re: #203: Timestamps "BC" raise "ValueError: second must be in 0..59"
"James Henstridge" <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On 17/01/2008, Tim Roberts <[email protected]> wrote: > James Henstridge wrote: > > One place where mx.DateTime and PostgreSQL disagree is on whether > > there is a "year zero". With Postgres, the two years before 0001 are > > 0001 BC and 0002 BC . With mx.DateTime, they are 0000 and -0001. The > > typecast and adapter code takes this into account. > > > > Interesting; I would have to call that a bug in mx. In calendar terms, > there is no year 0. The day before Jan 1, 1 AD was Dec 31, 1 BC. > > I suppose one could handle this easily enough in the conversions, but it > seems surprising. From the mx.DateTime documentaton: """ Dates before the Epoch are handled by extrapolating the calendars using negative years as basis (the year 1 BCE corresponds to the year 0, 2 BCE is represented as year -1 and so on). """ So it is the documented behaviour rather than a bug. James.