Re: convert interval info into days

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: convert interval info into days
Дата
Msg-id 20030822193619.GA32145@wolff.to
обсуждение исходный текст
Ответ на convert interval info into days  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
Список pgsql-general
On Fri, Aug 22, 2003 at 13:00:57 -0400,
  "Johnson, Shaunn" <SJohnson6@bcbsm.com> wrote:
> Howdy:
>
> I want to convert all of this into days, but
> I don't think I can use 'to_char' because
> I get things like this:

Converting intervals to days is a problem because months are treated as
having 30 days if you try to extract the number of seconds from the
interval (which could then be converted to days). If you have a base
date the interval is relative to, then I think you can get what you
want by extract the epoch from (base_date + interval) - base_date and
then divide by 24*60*60.

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

Предыдущее
От: Bjørn T Johansen
Дата:
Сообщение: Re: Inserting CR/LF in a select?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: WAL Files checkpoint_timeout with voluminous delete/insert