Re: date question?

From: Jim Mercer <jim(at)reptiles(dot)org>
To: KMiller <kmiller(at)2xtreme(dot)net>
Cc: postgres <pgsql-general(at)postgresql(dot)org>
Subject: Re: date question?
Date: 2000-11-01 02:19:31
Message-ID: 20001031211931.G25794@reptiles.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)reptiles(dot)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. ]

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Freedman 2000-11-01 04:18:05 Re: Query caching
Previous Message KMiller 2000-11-01 02:08:18 date question?