Re: function for date difference ?

From: Stephane Bortzmeyer <bortzmeyer(at)pasteur(dot)fr>
To: jprem <jprem(at)srmsoft(dot)co(dot)in>
Cc: postgresql <pgsql-general(at)postgresql(dot)org>, pgman <pgman(at)candle(dot)pha(dot)pa(dot)us>
Subject: Re: function for date difference ?
Date: 2000-06-30 14:36:10
Message-ID: 200006301436.QAA18372@ezili.sis.pasteur.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 30 June 2000, at 14 h 54, the keyboard of jprem <jprem(at)srmsoft(dot)co(dot)in>
wrote:

> is there any built-in function to find the difference between any two
> dates in postgresql 6.5.3 ?

You can do substraction on dates.

SELECT ending - starting FROM intervals;
SELECT * FROM intervals WHERE ending - starting > 86400::timespan;

If you want something more sophisticated, you have to read the dates into a
program (I do it with Perl) and use this program to perform all the operations
you wish.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Lawrence Jr. 2000-06-30 14:46:06 Footer Text
Previous Message Mitch Vincent 2000-06-30 14:19:52 Re: Large Tables(>1 Gb)