Re: Hopefully simple date conversion question

From: "Jason C(dot) Pion" <jpion(at)home(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Hopefully simple date conversion question
Date: 2000-07-29 17:49:47
Message-ID: Pine.LNX.4.21.0007291145080.18466-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message database 2000-07-29 17:54:56 select question
Previous Message dave 2000-07-29 16:07:05 Where is the reference manual?