Fundamentals

A Field Guide to Calendar Systems

Julian, Gregorian, and ISO week dates aren't interchangeable — and the edges where they disagree are exactly where date bugs tend to live.

"What day is it" turns out to have more than one correct answer depending on which calendar system is doing the counting — and a surprising number of date bugs come from code that assumes there's only one.

Julian vs. Gregorian: an 11-day gap that's still relevant

The Julian calendar (46 BCE) overcorrected for leap years slightly, adding a bit too much time roughly every century. By the 1500s the drift had reached about 10 days, and the Gregorian calendar (1582) fixed it going forward with a refined leap-year rule — but the switchover itself happened at wildly different times in different countries, some as late as the early 20th century. This is why historical dates before a given country's specific switchover year need to specify which calendar they're using to be unambiguous, and why Julian day numbers (a completely different concept — a continuous day count used in astronomy, not the Julian calendar itself) exist as a way to sidestep the ambiguity entirely.

ISO week dates: a calendar most people have never heard of

ISO 8601 doesn't just define a date format — it also defines a full alternate way of addressing a date, by year, week number, and weekday, written as 2026-W29-5. The catch is that an ISO week year doesn't line up with the calendar year at its edges: the first few days of January can belong to week 52 or 53 of the previous ISO year, and the last few days of December can belong to week 1 of the next one. This is precisely the kind of edge case the Week Number Calculator exists to get right, because getting it wrong by hand near a year boundary is easy and common.

Why this still matters in ordinary software

Almost no mainstream application needs to support the Julian calendar directly. But any system that stores or displays historical dates, does business with regions that use non-Gregorian calendars officially (several countries maintain a different official calendar alongside the Gregorian one), or generates ISO week-based reports needs to know these aren't universal, interchangeable conventions — they're specific systems with specific rules, and treating "date" as one single, simple concept is exactly the assumption that breaks at the edges.

Related

Related tools & reading