Re: Formatting intervals.. - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: Formatting intervals..
Date
Msg-id 3E75DC7A.80200@klaster.net
Whole thread Raw
In response to Re: Formatting intervals..  (Rajesh Kumar Mallah <mallah@trade-india.com>)
List pgsql-sql
Uz.ytkownik Rajesh Kumar Mallah napisa?:
> 
> Yes i realize what your are saying.
> its not a valid calculation. 
> 
> actually my original problem is
> that i have to display this duration
> in a human friendly way in my website.
> 
> shud i divide by 30 and tell the customer
> that its approximate ? 
> 
> but even that sounds amatuerish to me.
> hope i will be able to explain the marketing 
> guys ;-)
> 
> 
> 
> regds
> mallah.

What about this:
select age('1970-1-1'::date+your_interval,'1970-1-1'::date);

It should give you best result - the answer is true in 75% cases 
(depending on year)

Tomasz




pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: Formatting intervals..
Next
From: Rajesh Kumar Mallah
Date:
Subject: Re: Formatting intervals..