<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt" -->

---
title: Mini-post: Dates That Don't Exist | daily.dev
description: A short exploration of how programming languages handle historically non-existent dates — specifically October 5–14, 1582, which were removed when the Catholic...
canonical: https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Mini-post: Dates That Don't Exist | daily.dev
og:description: A short exploration of how programming languages handle historically non-existent dates — specifically October 5–14, 1582, which were removed when the Catholic...
og:url: https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt
og:image: https://api.daily.dev/og/posts/8Rd0cDDMt.png
og:image:alt: Mini-post: Dates That Don't Exist
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Mini-post: Dates That Don't Exist

**[Hacker News](https://daily.dev/sources/hn)** · 4 min read · 0 upvotes · 0 comments

## Summary

A short exploration of how programming languages handle historically non-existent dates — specifically October 5–14, 1582, which were removed when the Catholic world transitioned from the Julian to the Gregorian calendar. Ruby correctly rejects these impossible dates, while Python and Perl silently allow them. The post also highlights ncal(1) as the most correct implementation, since it accepts a country code to determine when each country made the calendar switch.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.yossarian.net/2015/06/09/Dates-That-Dont-Exist>

## Community take

How the wider developer community reacted, aggregated from 2 discussions and 76 comments across hackernews (as of 2026-08-04).

**TL;DR:** The community largely agrees that using the proleptic Gregorian calendar (ignoring the Julian/Gregorian switch) is the correct and pragmatic default for most date libraries, and that the post misrepresents Python and Perl by ignoring their documentation. The deeper debate is about whether any single calendar system can correctly handle the messy, country-specific history of calendar adoption.

**Sentiment:** 25% positive · 50% mixed · 25% skeptical

**The case for**

- The Perl DateTime library and Python's datetime module both explicitly document their use of the proleptic Gregorian calendar, so their behavior is correct as documented.
- Using the proleptic Gregorian calendar in standard libraries is a reasonable default, since the Julian/Gregorian switch happened at different times in different countries, making a single 'correct' civic calendar impossible.
- ncal's country-code approach is praised as a notably thorough attempt to handle per-country switch dates.
- Real-world use cases for pre-1582 dates do exist: genealogy software, astronomy, archival/library systems, knowledge bases like Wikidata, and Maya calendar research.

**The pushback**

- The post misquotes Python's documentation by omitting the key phrase 'idealized calendar… indefinitely extended in both directions,' making the criticism unfair.
- The post oversimplifies by treating 1582 as the universal switch date, when countries switched as late as 1923, making any single cutoff misleading.
- Even ncal's country-code approach is only a rough approximation, since calendar adoption varied by city, religion, and institution within countries.
- Libraries that skip the Julian/Gregorian gap but still allow Julian-only dates like February 29, 1500 are internally inconsistent.

**By community**

- hackernews (mixed): Commenters largely defend Python and Perl as correctly documented, critique the post's oversimplification of calendar history, and debate whether proleptic Gregorian is the right default — with most concluding it is, for practical purposes.

**Hottest debate:** Whether date libraries should implement the proleptic Gregorian calendar (ignoring the Julian/Gregorian switch entirely) or a 'civic' calendar that tracks the historically used system, given that the switch date varied by country.

**Open questions**

- How should libraries handle dates that are valid in the Julian calendar but not the Gregorian, such as February 29, 1500?
- Should there be a tzdb-equivalent database for calendar adoption dates by country/region?
- How do you correctly handle dates from historical figures or documents that span multiple calendar systems or countries?

**Highlights**

> 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
> — [autarch on hackernews · 1 comments](https://news.ycombinator.com/item?id=49171153)

> That is, the demonstrated behavior of Python is exactly what the documentation claims will happen. I believe the author is misrepresenting the documentation by writing: > Python's datetime module, despite claiming to represent a date object in "the current Gregorian calendar," sadly does not do so: This is an incomplete quote from the Python documentation. The full context is (emphasis mine): > A date object represents a date (year, month and day) in an idealized calendar, the current Gregorian calendar indefinitely extended in both directions. The Python documentation in the same paragraph says: > This matches the definition of the “proleptic Gregorian” calendar in Dershowitz and Reingold’s book Calendrical Calculations, where it’s the base calendar for all computations. Elsewhere it says that the datetime represents: "An idealized naive date, assuming the current Gregorian calendar always was, and always will be, in effect." P.S. The article is dated (2015).
> — [eesmith on hackernews](https://news.ycombinator.com/item?id=17071925)

> > 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_...
> — [deathanatos on hackernews · 2 comments](https://news.ycombinator.com/item?id=49171624)

> 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.
> — [broken-kebab on hackernews](https://news.ycombinator.com/item?id=49172666)

> Genealogical software, historical video games (CK2 has at least one mod which adds alternative calendars), I can imagine there are some needs for this in contract management software for countries with very old businesses and properties like England and Japan.
> — [tomjakubowski on hackernews](https://news.ycombinator.com/item?id=49175619)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=49136363) · 105 points · 74 comments
- [hackernews](https://news.ycombinator.com/item?id=17071513) · 1 points · 2 comments

## Similar posts on daily.dev

- [What is Date::ITALY?](https://daily.dev/posts/what-is-date-italy--ztenlumwc) · Hacker News · 0 upvotes · 0 comments
- [Historical Dates](https://daily.dev/posts/historical-dates-nat1698vv) · The Daily WTF · 0 upvotes · 0 comments
- [Time Wounds All Heels](https://daily.dev/posts/time-wounds-all-heels-bs3wps1we) · The Daily WTF · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#ruby](https://daily.dev/tags/ruby), [#perl](https://daily.dev/tags/perl)

[View this post on daily.dev](https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Mini-post: Dates That Don't Exist","url":"https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt"},"datePublished":"2026-08-04T15:30:53.049Z","dateModified":"2026-08-04T22:18:31.282Z","description":"A short exploration of how programming languages handle historically non-existent dates — specifically October 5–14, 1582, which were removed when the Catholic...","image":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","thumbnailUrl":"https://media.daily.dev/image/upload/s--ZrL_HSsR--/f_auto/v1722860399/public/Placeholder%2006","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/mini-post-dates-that-don-t-exist-8rd0cddmt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,ruby,perl","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Mini-post: Dates That Don't Exist"}]}
```

