Re: Function to convert from (integer) UNIXTIME to DATETIME

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: "Morten W(dot) Petersen" <morten(at)src(dot)no>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Function to convert from (integer) UNIXTIME to DATETIME
Date: 2000-06-26 16:51:36
Message-ID: 39578A18.D4CF4B65@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2000-06-26 17:07:18 Conversion of MySQL to PostgreSQL
Previous Message Ryan Ho 2000-06-26 16:46:30 How to install perl module without root access