Re: converting seconds since epoch to time string

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: wmorrow(at)home(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: converting seconds since epoch to time string
Date: 2000-11-14 23:23:53
Message-ID: 6963.974244233@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Bill Morrow <wmorrow(at)home(dot)com> writes:
> I have an integer column which holds a time represented
> as the number of seconds since 1970/01/01 00:00 UTC. I want to
> view this table with the time converted to an understandable text string.

Casting to abstime should do it; from there you might want to convert
to timestamp so you can invoke to_char, if you don't like the default
display format.

Next time, try representing the column as a date/time datatype in the
first place ;-)

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message ghaverla 2000-11-15 01:48:47 Re: converting seconds since epoch to time string
Previous Message Bill Morrow 2000-11-14 23:04:20 converting seconds since epoch to time string