Converting epoc number to timestamp

From: Doug Silver <dsilver(at)urchin(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Converting epoc number to timestamp
Date: 2002-05-10 00:26:13
Message-ID: Pine.LNX.4.21.0205091657210.11032-100000@danzig.sd.quantified.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Just curious if there's a way in Postgres to take an epoch number (UTC)
which is stored as a bigint field and convert it to a timestamp.

perl does it like so:

$ perl -e 'print localtime(1020990264)."\n"'
Thu May 9 17:24:02 2002

Didn't see anything in the stored functions, but wanted to be sure. If
not, would it make sense to create my own function that would do it in the
database or just code it on the front end (i.e. web app)?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Doug Silver
Network Manager
Urchin Corporation http://www.urchin.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message hodges 2002-05-10 01:37:50 Time Formatting
Previous Message John Nix 2002-05-09 19:41:44 Re: Newbie Date Problems