Re: converting seconds since epoch to time string - Mailing list pgsql-novice

From Tom Lane
Subject Re: converting seconds since epoch to time string
Date
Msg-id 6963.974244233@sss.pgh.pa.us
Whole thread Raw
In response to converting seconds since epoch to time string  (Bill Morrow <wmorrow@home.com>)
List pgsql-novice
Bill Morrow <wmorrow@home.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

pgsql-novice by date:

Previous
From: Bill Morrow
Date:
Subject: converting seconds since epoch to time string
Next
From: ghaverla@freenet.edmonton.ab.ca
Date:
Subject: Re: converting seconds since epoch to time string