Skip site navigation (1) Skip section navigation (2)

Re: Trouble with UNIX TimeStamps

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jonathan Chum <jchum(at)aismedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trouble with UNIX TimeStamps
Date: 2002-12-27 14:38:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Fri, Dec 27, 2002 at 08:49:58 -0500,
  Jonathan Chum <jchum(at)aismedia(dot)com> wrote:
> The table column, ticket_starters.ticket_time_start is an INT type which
> contains a UNIX timestamp. I did not see anywhere in the Interactive docs
> how'd I convert the UNIX timestamp into a timestamp type so I can extract
> the day name. I'd rather not use PostGreSQL's timestamp types and just
> convert the database over to it since much of the programming utilizes the
> UNIX timestamp.  Any ideas?

One way to do this is:
area=> select to_char('epoch'::timestamp + (1040999196 || ' seconds')::interval,'Day');
(1 row)

In response to


pgsql-general by date

Next:From: Jonathan ChumDate: 2002-12-27 14:58:14
Subject: Re: Trouble with UNIX TimeStamps
Previous:From: Jonathan ChumDate: 2002-12-27 13:49:58
Subject: Trouble with UNIX TimeStamps

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group