Re: date time function

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: date time function
Дата
Msg-id 46841678.4090701@iol.ie
обсуждение исходный текст
Ответ на date time function  ("Jasbinder Singh Bali" <jsbali@gmail.com>)
Ответы Re: date time function
Список pgsql-general
On 28/06/2007 21:04, Jasbinder Singh Bali wrote:

> How can i convert this result into absolute number of days.

Cast your result to type INTERVAL - something like this:

postgres=# select (current_timestamp - timestamp '2007-05-01')::interval;

        interval
----------------------
  58 days 21:10:36.748
(1 row)

Of course, you'll need to decide how to handle the part of a day left over.

HTH,

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------

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

Предыдущее
От: "Jasbinder Singh Bali"
Дата:
Сообщение: date time function
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: date time function