Join the discussion

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

  • Hacker News
  • ... And then there was Sweden.

    Instead of flipping the switch in the 1500s... or 1700s... they instead did a slow roll out until they finally flipped the switch and did a big leap.

    https://www.americanscientist.org/article/date-distinctions

        In “The Future of Time,” the authors state that “different countries and religions adopted the reforms [the Gregorian calendar] at different times and in different ways. In 1712 Sweden added a February 30 to its national calendar.” There was a February 30 in Sweden in 1712, but the context in which it is presented in the article is misleading. In 1700 the Swedes decided to switch from the Julian to the Gregorian calendar by eliminating leap-year days for 40 years. So 1700, which is a Julian leap year but not a Gregorian leap year, did not have a leap day. In both 1704 and 1708, through bureaucratic error, there were leap days. In 1712, the situation was resolved by switching back to the Julian calendar; this meant that the missing leap day that would have occurred in 1700 had to be added, and was, as February 30. It wasn’t until 1753 that the Swedes finally adopted the Gregorian calendar by making the date March 1 follow February 17.
  • So, the Proleptic Gregorian Calendar[1] refers to what you'd get if you extended the current Gregorian Calendar back in time before its introduction. (It agrees with the Julian calendar only during the 3rd century AD.) Most date libraries use the Proleptic calendar for simplicity. Ruby's DateTime is unusual insofar as, by default, it actually switches to the Julian calendar for dates before Oct 15 1582.

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

  • Using the proleptic Gregorian calendar for historical dates is only a problem if you want to compute the day of the week (which those missing days will throw off prior to the adoption of the Gregorian calendar in the relevant country) or the number of days between two historical dates (if the two dates span the date when the Gregorian calendar was adopted).

    And, frankly, there are other problems to deal with beyond correctly handling the Julian/Gregorian switch. In Nelson's Navy, for example, the new day started at noon rather than midnight as we'd expect. AM could be June 1st, PM could be June 2nd, and both could be Tuesday.

    And then there are lots of historical events with dates like "on or about August 6th" or "mid-September" or the "in the Fall of".

    Trying to deal with historical dates in what a programmer would consider a perfectly correct way is something of a fool's game.

  • As da_chicken pointed out, it's also a problem if you want to record a date like February 29, 1700, which is a perfectly valid date in the Julian calendar but simply doesn't exist in the proleptic Gregorian calendar.

    Dates are messy.

  • There seems to be disagreement about the year. Two systems I checked assume 1752, not 1582.

    (OpenBSD)

      $ man cal
      [...]
      The Gregorian Reformation is assumed to have occurred in
      1752 after the 2nd of September.  By this time, most
      countries had recognized the Reformation (although a few
      did not recognize it until the early 1900s). Eleven days
      following that date were eliminated by the Reformation, so
      the calendar for that month is a bit unusual.
    
    (Ubuntu Linux)

      [...]
      -s country_code
          Assume the switch from Julian to Gregorian Calendar at
          the date associated with the country_code.  If not
          specified, ncal tries to guess the switch date from the
          local environment or falls back to September 2, 1752.
          This was when Great Britain and her colonies switched
          to the Gregorian Calendar.
  • agreed
  • It depends on the country.

    1582 is Catholic Europe

    1700 or 1701 is Protestant Europe

    1752 is Great Britain and its colonies which include USA

    1918 is Russia

    1923 Greece

    https://en.wikipedia.org/wiki/Adoption_of_the_Gregorian_cale...

  • 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.

  • It's not a wrong way to think about it. There are some use cases for proleptic calendars, but there are just as many where it's completely inappropriate. If you ever need to compare what day you think it is with what day someone in the past thought it was, then yes those dates don't exist in any real sense.

    I wouldn't say it's it's straightforward to convert between them, either. The Gregorian calendar was first adopted in 1582, but the UK and it's colonies didn't follow suit until 1752. Russia didn't convert until 1918, and Greece didn't switch until 1923. We're just over 100 years out from active use of the Julian calendar. So you have to know who the speaker is and where they are or where they are from to know what they mean.

    Since these places switched at different times, they had to skip a different number of days. It was 10 in the 16th century. It was 13 in the 20th!

    If you're reading a journal by a British man who lived in Russia through the end of the Great War and then moved to Greece in 1920, what does he mean when he's talking about a lunar eclipse he just witnessed?

  • I would think of it as Calendar A uses Calandar B until time point T and then uses Calendar C. These dates exist in Calendars B and C, but do not exist in Calendar A.
  • The way I imagine it is like the calendars are both rulers that are slightly off from each other. We were using one ruler, and at a certain point we went from using one to the other, so our "present" was never mapped to those dates. But you can represent any point in time as any of those calendars, like we can represent a specific temperature as Fahrenheit or Celsius. The calendars extend forwards and backwards to infinity.
  • 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

  • A primary reason for the Catholic Church changing the calendar was to bring the date of Easter back into conformance with the decree of the Council of Nicaea on the topic. There was a controversy in the early Church on this, there were even miracles worked concerning the correct date -- see Dom Gueranger's "Liturgical Year" for some of the accounts.
  • Fun related fact, many dates -- for example, birth dates on headstones -- of people born in countries observing Eastern Orthodox Christianity will have the prefix O.S. (old style) to disambiguate dates using the original Julian and either the Georgian or Revised Julian calendars which were in effect at that person's death.
  • 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 British (including the American colonies) also did an arguably even more confusing calendar change in 1752, by switching the start of the new year from March 25 to January 1.
  • 1752 is before the invention of timezones, but that adds another curiousity about "what date did X happen?". On the calendar of Country A it could've been October 31, 1752, and on the calendar of Country B it would've been October 21...
  • 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_...

  • > Those 10 days certainly exist, in both calendar systems.

    Not in the standard Gregorian calendar. Those dates only exist in the proleptic Gregorian calendar. The standard Gregorian calendar explicitly skips them. That's because you can't feasibly go back and change all the Julian dates that had been physically written down for centuries. That's why it's called the Gregorian "shift".

  • Messiness is an understatement :)

    Thanks. I haven’t known that countries switched in different years.

    Gregorian calendar is just one piece.

    https://en.wikipedia.org/wiki/Civil_calendar

    Eighteen countries use another calendar alongside the Gregorian calendar…

  • 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

  • Who else uses the proleptic Gregorian calendar other than programmers of datetime libraries?