From: Tomasz Myrta <jasiek@klaster.net>
To: Rajesh Kumar Mallah <mallah@trade-india.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Formatting intervals..
Date: Mon, 17 Mar 2003 15:32:26 +0100
Message-ID: <3E75DC7A.80200@klaster.net> (raw)
In-Reply-To: <200303171834.54623.mallah@trade-india.com>
References: <200303171717.25857.mallah@trade-india.com>
<3E75B800.7000902@klaster.net>
<200303171834.54623.mallah@trade-india.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jasiek@klaster.net, mallah@trade-india.com
Subject: Re: Formatting intervals..
In-Reply-To: <3E75DC7A.80200@klaster.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox