Re: convert from epoch to timestamp

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Celia McInnis <celia(at)drmath(dot)ca>
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: convert from epoch to timestamp
Date: 2005-05-09 21:01:36
Message-ID: 20050509210136.GA10972@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, May 06, 2005 at 19:39:26 -0500,
Celia McInnis <celia(at)drmath(dot)ca> wrote:
> This time I'll give an appropriate subject...

Please don't reply to existing threads to start a new one, even if you change
the subject.

> How to I convert from EPOCH time to a "TIMESTAMP WTHOUT TIME ZONE" type?

The simplest is probably:
select 1::abstime at time zone 'UTC';
Where you replace '1' by whatever number has the integer number of seconds
since the epoch. If you need fractional seconds then you need to multiply
the number seonds times and interval of 1 second and add it to the
the start of the epoch.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-05-09 21:04:09 Re: returned row number
Previous Message Cima 2005-05-09 18:40:29 downloading files- more details