# The Ten Days That Never Happened: How Programming Languages Handle a Missing Slice of 1582

Original title: Dates That Don't Exist (2015)

> Hacker News story 49136363 · language: en · submitted 2026-08-01
> Web version: https://zeli.app/story/49136363
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 124 · by [EndXA](<https://news.ycombinator.com/user?id=EndXA>) · 💬 85
[original](<https://blog.yossarian.net/2015/06/09/Dates-That-Dont-Exist>) · [HN discussion](<https://news.ycombinator.com/item?id=49136363>)

## Summary

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.

## Key quote

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

## HN discussion (85 comments)

### [autarch](<https://news.ycombinator.com/item?id=49171153>)

> 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

### [maxlybbert](<https://news.ycombinator.com/item?id=49171157>)

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

### [woodruffw](<https://news.ycombinator.com/item?id=49170735>)

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

### [throwawayk7h](<https://news.ycombinator.com/item?id=49171182>)

> 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

### [SoftTalker](<https://news.ycombinator.com/item?id=49171026>)

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

---

## Cite

- Page: https://zeli.app/story/49136363
- Date: 2026-08-01
- Source: blog.yossarian.net (https://blog.yossarian.net/2015/06/09/Dates-That-Dont-Exist)
- Hacker News: https://news.ycombinator.com/item?id=49136363

## Other languages

- zh: https://zeli.app/zh/story/49136363 · markdown: https://zeli.app/zh/story/49136363.md
- ja: https://zeli.app/ja/story/49136363 · markdown: https://zeli.app/ja/story/49136363.md
- ko: https://zeli.app/ko/story/49136363 · markdown: https://zeli.app/ko/story/49136363.md
- de: https://zeli.app/de/story/49136363 · markdown: https://zeli.app/de/story/49136363.md
- es: https://zeli.app/es/story/49136363 · markdown: https://zeli.app/es/story/49136363.md
