Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • This is clearly the wrong way to think about it. Dates forward and backward from this flag date exist in both calendars and it's straightforward to convert between them.

    Such a flag day didn't involve removing days from one calendar or the other, it switched between them.

  • This whole story is built on one wrong assumption: that there are some clear rules defining calendar shifts. As the author discovers at the end this history differs in different countries, and what dates exist is not anymore easy to tell universally. But now let's recall countries are not the same anymore, so even ncal's admirably nerdy attempt to be precise is just a rough approximation. Then how about a Catholic town in a Protestant country, or vice versa? How about people using several calendars simultaneously for different purposes? The truth is there's no clear recipe for every case, and for ≈99.9999% cases proleptic Gregorian (which doesn't care) is completely fine.
  • > The Eastern Orthodox church even continued well after that, only switching to the Gregorian calendar in 1929.

    Technically, they switched to the Revised Julian[0] calendar, not the Gregorian. Also, it was only some of the churches making up Eastern Orthodoxy that switched; others remain on the Julian calendar to this day, and all of them still use the Julian calendar to calculate the date of Pascha.

    [0] https://en.wikipedia.org/wiki/Revised_Julian_calendar

  • This is an interesting detail to learn about history. However, like the article mentions near the end, the Gregorian calendar was adopted at different times in different countries. The Anglican Church didn’t trust the Catholics, so Great Britain adopted the Gregorian calendar in 1752 ( https://en.wikipedia.org/wiki/Calendar_(New_Style)_Act_1750 ). And they did their best to hide the fact that they were adopting a Catholic invention: it’s the “New Style Calendar” and they came up with a different way to choose the same date for Easter.

    1752 is late enough that Benjamin Franklin, George Washington, Thomas Jefferson and others were born before that change.

    I think that’s the reason that programming languages tend to adopt the proleptic Gregorian calendar and leave it up to the programmer to figure out when the calendar was adopted in the countries they care about.

    Except that countries apparently had to answer various questions when they adopted the Gregorian calendar, and they didn’t all chose the same answers. Ideally, we’d have something like tzdb but for calendar adoption. But I guess the need doesn’t come up all that often.

  • The article is a bit old. It should have noted a new development in calendar technology if it was written half a year later.

    > In A.D. 1582 Pope Gregory XIII found that the existing Julian calendar insufficiently represented reality, and changed the rules about calculating leap years to account for this. Similarly, in A.D. 2013 Rockchip hardware engineers found that the new Gregorian calendar still contained flaws, and that the month of November should be counted up to 31 days instead.

    https://lwn.net/Articles/669022/

  • It’s funny to see this on HN. I wrote this 11 years ago as an undergraduate.

    The afternotes at the end of the post are worth reading; people have sent me various qualifications and corrections over the years.

  • > In essence, then, those ten days in 1582 never happened and simply do not exist within the Gregorian calendar system used almost universally in the West today.

    I find these things so much easier to think about if you consider the change as a change from one calendar system to another calendar system. Those 10 days certainly exist, in both calendar systems, they just represent different points in time. I.e., I think it's easier to just consider both calendar systems as the rules, extended forward & backwards infinitely ("proleptic"). Some people switched from a Julian calendar to a Gregorian one in 1582.

    "Some people did not experience days with these labels in some areas of the world" … I get where it's coming from, but it's not how I'd build a library.

    If you worry about the switch, then you have to ask "which switch?" which TFA only lightly touches on. The 1582 one is famous, of course, but not everyone switched, and other parts of the worlds switched as time went on, to as late as 1918, when Russia switched.[1] (And you can see other messiness in that table, too.)

    Needing to deal with it is niche enough that I think most language std libs should implement the proleptic Gregorian calendar, and let an application whose niche requires it deal with the switch (& whichever switch it requires).

    [1] https://en.wikipedia.org/wiki/List_of_adoption_dates_of_the_...

  • I'm the author of the Perl DateTime library. It works correctly as _documented_. Here's the first two paragraphs of the docs:

    > DateTime is a class for the representation of date/time combinations, and is part of the Perl DateTime project.

    > It represents the Gregorian calendar, extended backwards in time before its creation (in 1582). This is sometimes known as the "proleptic Gregorian calendar". In this calendar, the first day of the calendar (the epoch), is the first day of year 1, which corresponds to the date which was (incorrectly) believed to be the birth of Jesus Christ

    Always RTFM.

    Edit: I double-checked, and while this was not in the docs in the first release, it _was_ in the docs as of 2015.

    https://metacpan.org/pod/DateTime

Explore Birbla archives