Re: Q: timestamp - timestamp

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Q: timestamp - timestamp
Дата
Msg-id 200305011116.21630.josh@agliodbs.com
обсуждение исходный текст
Ответ на Q: timestamp - timestamp  (Sepp Rudel <sepprudel@yahoo.com>)
Список pgsql-novice
Sepp,

> this must be a no-brainer but I just can't get this
> working: I'd like to substract one timestamp from
> another and have the result as integer/seconds, e.g.:
>
> 2003-04-28 14:10:00+01 - 2003-04-28 14:00:00+01

SELECT extract(epoch FROM '2003-04-28 14:10:00+01'::timestamptz) -
extract(epoch FROM '2003-04-28 14:00:00+01'::timestamptz)

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology     josh@agliodbs.com
    and data management solutions     (415) 565-7293
   for law firms, small businesses      fax 621-2533
    and non-profit organizations.     San Francisco


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

Предыдущее
От: Sergey Holod
Дата:
Сообщение: Making "SECURITY DEFINER" procedures
Следующее
От: eurlix
Дата:
Сообщение: Re: Optimizing POSTGRESQL config