Re: Reg Date/Time function

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: segu(dot)sandeep(at)gmail(dot)com
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Reg Date/Time function
Date: 2017-08-01 18:04:13
Message-ID: CAEfWYywhKmNBCZuJ6j+_MtuCPSkYBGGhuzxX2yasktDyuzSk3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Per the docs, justify_days is to "Adjust interval so 30-day time periods
are represented as months" so 360 days = 12 months = 1 year so 365 days is
1-year 5-days.

There are all sorts of oddities and special assumptions regarding date/time
calculations made even more complicated by the need to support special
use-cases such as 30/360 financial coupon factor calculations (every month
is 30-days and years have 360 days).

Cheers,
Steve

On Mon, Jul 31, 2017 at 5:30 PM, <segu(dot)sandeep(at)gmail(dot)com> wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/8.2/static/functions-datetime.html
> Description:
>
> Hi,
> I am going through PostgreSQL, for the first day. And it was great till
> now.
> One quick question/doubt regarding the function
> &quot;justify_days(interval)&quot;
>
> select justify_days(interval &#39;365 days&#39;);
>
> this statement returns 1 year 5 days, whereas I feel it should be just 1
> year.
>
> Please correct me if I am wrong.. Thanks for all your time.
>
> --
> Sent via pgsql-docs mailing list (pgsql-docs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-docs
>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Sandeep Segu 2017-08-01 18:50:04 Re: Reg Date/Time function
Previous Message Andres Freund 2017-08-01 17:33:37 Re: Use of term Master/Slave