Re: Trouble with UNIX TimeStamps

Поиск
Список
Период
Сортировка
От will trillich
Тема Re: Trouble with UNIX TimeStamps
Дата
Msg-id 20021227100853.E29164@serensoft.com
обсуждение исходный текст
Ответ на Re: Trouble with UNIX TimeStamps  ("Jonathan Chum" <jchum@aismedia.com>)
Список pgsql-general
> -----Original Message-----
> Sent: Friday, December 27, 2002 9:38 AM
>
> One way to do this is:
> area=> select to_char('epoch'::timestamp + (1040999196 || '
> seconds')::interval,'Day');
>   to_char
> -----------
>  Friday
> (1 row)

On Fri, Dec 27, 2002 at 09:58:14AM -0500, Jonathan Chum wrote:
> Sorry, I'm still to new with using functions within PostGreSQL, but . . .
> SELECT to_char((1040999196 || ' seconds')::interval +
> ticket_starters.ticket_time_start::timestamp ,'Day') FROM ticket_starters;
>
> and it returned back:
>
> ERROR:  Cannot cast type integer to timestamp without time zone
>
> In my table, the column, ticket_time_start has a INTEGER value of
> '1009462540' which is today's date.
>
> How'd would I construct the query to pull from the db?

SELECT
    to_char('epoch'::timestamp +
        (a_table.unix_seconds_field || ' seconds')::interval,
        'Day')
WHERE
    some.condition > particular.thingie
    ;

i think...

--
"We will fight them on the beaches, we will fight them on the
sons of beaches" -- Miguel Churchill, Winston's bastard Mexican
brother.
--lifted from http://www.astray.com/acmemail/stable/documentation.xml


will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Trouble with UNIX TimeStamps
Следующее
От: Simon Mitchell
Дата:
Сообщение: Re: Trouble with UNIX TimeStamps