Re: date question? - Mailing list pgsql-general

From Jim Mercer
Subject Re: date question?
Date
Msg-id 20001031211931.G25794@reptiles.org
Whole thread Raw
In response to date question?  ("KMiller" <kmiller@2xtreme.net>)
List pgsql-general
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.  ]

pgsql-general by date:

Previous
From: "KMiller"
Date:
Subject: date question?
Next
From: "Bernie Huang"
Date:
Subject: strange array insertion