Re: Hopefully simple date conversion question - Mailing list pgsql-general

From Jason C. Pion
Subject Re: Hopefully simple date conversion question
Date
Msg-id Pine.LNX.4.21.0007291145080.18466-100000@localhost.localdomain
Whole thread Raw
In response to Re: Hopefully simple date conversion question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, 28 Jul 2000, Tom Lane wrote:

>   * convert the value to Unix timestamp notation (subtract off enough
>     days to make 0 correspond to 1/1/1970, then multiply by 24*60*60).
>   * coerce the resulting integer to abstime and then to whatever
>     datatype you want to use (timestamp or date, likely).

This worked perfectly.  Thanks very much for the help.

> This will not work if you have any dates before about 1900, however,
> since the Unix timestamp value would underflow.

No problem there.  Thankfully, none of the dates go that far back.

>             regards, tom lane

Thanks again for all the work on PostgreSQL.

Jason


pgsql-general by date:

Previous
From: dave
Date:
Subject: problem compiling php for pgsql
Next
From:
Date:
Subject: select question