How calendars count days: continuous numbers behind irregular months
The cleanest way to think about dates is to ignore the names and count days as integers. A Julian day number does exactly that: a single unbroken count of days (and fractions) starting far in the past, assigned to every instant regardless of calendar. Subtract two Julian day numbers and you have the elapsed days — no month tables, no leap rules, no ambiguity. This is why astronomers, historians, and every robust date library reduce calendar dates to day numbers first and convert back only for display.
Calendar arithmetic, by contrast, has two distinct modes that people constantly confuse:
- Adding days to a date moves by exactly 24-hour steps: January 31 plus one day is February 1, because the calendar itself handles the irregular month length.
- Adding months or years is calendar arithmetic: January 31 plus one month is undefined in some systems and February 28 in others (the classic "end-of-month clamp"). Adding one year to February 29, 2024 lands on March 1 in most programming libraries and February 28 in others — and that one-day difference propagates into every deadline computed afterward.
The Gregorian calendar's structure is deliberately uneven: months alternate 30 and 31 days (except February), giving an average month of 30.44 days — 365.25/12 — so month-based differences and day-based differences can never quite agree. Any tool that reports "10 months = 304 days" has quietly picked one convention over the other.