Re: convert interval info into days - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: convert interval info into days
Date
Msg-id 20030822193619.GA32145@wolff.to
Whole thread Raw
In response to convert interval info into days  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
List 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 by date:

Previous
From: Bjørn T Johansen
Date:
Subject: Re: Inserting CR/LF in a select?
Next
From: Tom Lane
Date:
Subject: Re: WAL Files checkpoint_timeout with voluminous delete/insert