Thread: date question?

date question?

From
"KMiller"
Date:
Is there a way using the existing date/time functions to express any interval between two dates in days?
 
The output from age() is close but it breaks hte result out by year,month,day.
 
TIA, -km
 

Re: date question?

From
Jim Mercer
Date:
On Tue, Oct 31, 2000 at 06:08:18PM -0800, KMiller wrote:
> Is there a way using the existing date/time functions to express any interval between two dates in days?
>
> The output from age() is close but it breaks hte result out by year,month,day.

could try something like:

dbname=> select
    date_part('epoch', age('1999-01-01', '1999-02-01'))
       / 60 / 60 / 24;
?column?
--------
     -30
(1 row)


--
[ Jim Mercer                 jim@reptiles.org              +1 416 410-5633 ]
[          Reptilian Research -- Longer Life through Colder Blood          ]
[  Don't be fooled by cheap Finnish imitations; BSD is the One True Code.  ]