Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year

From: Bruce Hunsaker <hunsakerbn(at)ldschurch(dot)org>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, <hunsakerbn(at)familysearch(dot)org>, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year
Date: 2014-11-06 14:29:49
Message-ID: 20141106142949.GA4487@gr8.dev
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 06 Nov 14 02 34, Bruce Momjian wrote:
> On Wed, Nov 5, 2014 at 01:13:21PM -0500, Tom Lane wrote:
> > Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > > On Wed, Nov 5, 2014 at 7:02 PM, Bruce Momjian <bruce(at)momjian(dot)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.

Thanks everyone for the response. I guess the bottom line for us
is that if we want to store dates before 1582, we may not want
to use date or timestamp columns for that data, particularly if
the dates are from a Julian calendar.

--
Bruce Hunsaker

NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message louellet 2014-11-06 16:48:14 BUG #11901: Full text search: thesaurus size limit
Previous Message Bruce Momjian 2014-11-06 07:34:51 Re: BUG #11883: Year 1500 not treated as leap year when it was a leap year