Re: Function to convert from (integer) UNIXTIME to DATETIME - Mailing list pgsql-general

From Ed Loehr
Subject Re: Function to convert from (integer) UNIXTIME to DATETIME
Date
Msg-id 39578A18.D4CF4B65@austin.rr.com
Whole thread Raw
In response to Function to convert from (integer) UNIXTIME to DATETIME  ("Morten W. Petersen" <morten@src.no>)
List pgsql-general
"Morten W. Petersen" wrote:
>
> Is there such a function (couldn't find it)

I haven't seen one, but here's one that might work:

select '1-Jan-2000'::datetime + ( 962037634 - ( date_part( 'epoch',
'1-Jan-2000'::datetime) )||' second')::interval"

Regards,
Ed Loehr

pgsql-general by date:

Previous
From: "Poul L. Christiansen"
Date:
Subject: Re: Conversion from MS Access to Postgresql
Next
From: Bruce Momjian
Date:
Subject: Conversion of MySQL to PostgreSQL