Dates That Don't Exist (2015)
- Programming
- Infrastructure
- History
- Developer Tools
The post shows a classic calendaring trap: when Pope Gregory XIII introduced the Gregorian calendar in 1582, some places skipped a block of dates to realign the calendar, so labels like October 10, 1582 did not exist in those jurisdictions. It then compares language behavior and treats libraries that accept such dates without complaint as getting history wrong. The strongest correction is that this only makes sense if you mean a specific civic calendar for a specific place. Most programming languages and date libraries deliberately use the proleptic Gregorian calendar, which extends today’s Gregorian rules backward indefinitely and treats those dates as valid. That is not a bug. It is a design choice that keeps arithmetic consistent and avoids embedding every country’s adoption history into the default date type.
If your product stores or compares historical dates, you need to pick a calendar model explicitly instead of assuming the standard library matches user expectations. For most software, proleptic Gregorian plus clear documentation is fine, but archival, genealogy, legal, and history-heavy systems need jurisdiction-aware rules or custom calendar handling.
-
blog.yossarian.net
- Discuss on HN