Skip to content

Date & Calendar Math

Date & Calendar Math covers arithmetic that has to reckon with the actual shape of the Gregorian calendar: months of different lengths, a leap day that shows up once every four years (mostly), weeks that do not divide evenly into months, and quarters that start on different dates depending on which fiscal convention applies. A date difference, an offset, a weekday lookup, or a "which quarter is this" question all live here.

Why calendar-month addition is not just "add 30 days"

Adding one calendar month to January 31 has no single obviously correct answer, because February does not have 31 days. WhenMath's default is to constrain the result to the last valid date of the target month (January 31 plus one month lands on February 28, or February 29 in a leap year), with an alternative "preserve end-of-month" rule available where it matters, and the choice always stated in the result rather than assumed silently. A calendar month and a fixed 30-day span are treated as genuinely different questions, because they usually produce different dates.

Inclusive counting is a choice, not a default

Counting the days "between" two dates can mean including both endpoints, excluding both, or (the convention used unless stated otherwise) excluding the start and including the end. The same two dates can produce three different correct-looking numbers depending on which rule is used, so every date-difference result says which one it applied.

Where to go next

Once weekends and holidays need to be excluded from a calendar span, see Business Days & Work Calendar. Once a date result needs to feed into a deadline or plan, see Deadlines & Project Capacity.

Date & Calendar Math tools