Re: How to represent dates BC

2012-07-28 Thread jwp
On Tuesday, July 24, 2012 2:55:29 AM UTC-7, Laszlo Nagy wrote: > >>> conn.getqueryvalue("select '1311-03-14 BC'::date") > What is the good representation here? Should I implement my own date Do your datetime formatting in postgres: "select '1311-03-14 BC'::date::text" PG does have a have a reas

Re: How to represent dates BC

2012-07-24 Thread Laszlo Nagy
On 2012-07-24 12:29, Christian Heimes wrote: Am 24.07.2012 11:55, schrieb Laszlo Nagy: What is the good representation here? Should I implement my own date type? (I wouldn't want to.) JDN [1] is a commonly used format for wide ranges of dates. I've used it in the past to refer to days BC. PyPI

Re: How to represent dates BC

2012-07-24 Thread Christian Heimes
Am 24.07.2012 11:55, schrieb Laszlo Nagy: > What is the good representation here? Should I implement my own date > type? (I wouldn't want to.) JDN [1] is a commonly used format for wide ranges of dates. I've used it in the past to refer to days BC. PyPI offers a Python module [2] that looks well w

How to represent dates BC

2012-07-24 Thread Laszlo Nagy
>>> import datetime >>> old_date = datetime.date(1,12,31) >>> str(old_date) '0001-12-31' >>> one_year = datetime.timedelta(days=365) >>> str(one_year) '365 days, 0:00:00' >>> old_date - 10*one_year Traceback (most recent call last): File "", line 1, in OverflowError: date value out of range >>>