Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year - Mailing list pgsql-bugs

From Bruce Momjian
Subject Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year
Date
Msg-id 20141106073451.GA4253@momjian.us
Whole thread Raw
In response to Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year  (Bruce Hunsaker <hunsakerbn@ldschurch.org>)
List pgsql-bugs
On Wed, Nov  5, 2014 at 01:13:21PM -0500, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > On Wed, Nov 5, 2014 at 7:02 PM, Bruce Momjian <bruce@momjian.us> wrote:
> >> Because 1500 % 100 == 0, I think 1500 was not a leap year.
>
> > I believe it was a leap year in the Julian calendar, maybe that's
> > where the difference comes from?
>
> Indeed.  We won't be changing our code though, because we document that
> we follow Gregorian calendar rules even before that calendar was instituted
> (ie, proleptic Gregorian calendar).  You could argue for doing that
> differently, but then what are you going to do for dates before the Julian
> calendar was instituted?  In any case, this behavior appears to be
> required by the SQL standard, which repeatedly says that datetime values
> are "constrained according to the Gregorian calendar".

I have applied the attached C comment to document why we use the
Gregorian calendar for pre-1582 years.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

Attachment

pgsql-bugs by date:

Previous
From: Robert Haas
Date:
Subject: Re: ltree::text not immutable?
Next
From: Bruce Hunsaker
Date:
Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year