The Ten Days That Never Happened: How Programming Languages Handle a Missing Slice of 1582
Dates That Don't Exist (2015)

In 1582, the Catholic world skipped ten days to switch from the Julian to the Gregorian calendar, making October 5–14 of that year nonexistent. This post tests how Ruby, Python, and Perl's DateTime handle these impossible dates. Ruby correctly raises an error, while Python and Perl silently accept them, revealing a gap in date/time correctness. The author also notes that the ncal tool can be more accurate by accounting for different countries' adoption dates.
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.
- pibaker
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.
- elendilm
Dates really are a headache.
In our Dip (in house db) client library, we built what we called a policy that auto selects partitions based on every crud operations. The policies can be specified once for each collection in collections.json based on fields or query.
So for policies where partition involves the date type fields, be it range or fixed dates, it was incredibly hard to generate universal date names from ranges.
The policy mechanism was finished fairly quickly as Dip is inherently distributed first. But reasoning about date names was so incredibly hard.
The missing dates mentioned in the article did come up during development adding to the woes.
But the upside now is that application code no longer worries about the distributed partitions. Policy handles that. Some sort of architecture as code. Don't know whether AAC is an existing term or whether we coined it.
- jaculabilis
> 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.