converting an epoch to a timestamp

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: converting an epoch to a timestamp
Date: 2002-01-10 01:25:27
Message-ID: GNELIHDDFBOCMGBFGEFOMEBECBAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

How does one go about converting a UNIX epoch (ie. int4) to a timestamp?

These don't work:

("datetime" is the int4 field)

extract(timestamp from epoch datetime)
extract(timestamp from datetime)

I'm using 7.1.3, but am also interested in 7.2 solutions. And if it isn't
part of extract, shouldn't it be?

Chris

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-01-10 01:59:04 Re: converting an epoch to a timestamp
Previous Message Josh Berkus 2002-01-10 01:13:35 Re: problem with date and to_char