CALENDAR ARITHMETIC

Comparing direct and sequential year shifts from leap day

Adding years to February 29 gives different results depending on whether you shift once or in steps. This worksheet follows 2024-02-29 along three paths and explains the clamping rule behind them.

The question about leap days

February 29 exists only in leap years, so adding whole years to it raises a problem: what date should appear when the target year has no February 29. The add years calculator answers by clamping, which means it moves to February 28 in a nonleap year. That is a reasonable choice, and it has a side effect: a sequence of small shifts can end at a different date than one large shift. The worksheet starts from 2024-02-29 and compares a direct jump of four years with a path that stops in a nonleap year on the way. The destination year is the same, 2028, and the dates differ by a day. Birthdays, warranties, subscriptions and leases are typical places where this question appears, because each of them repeats yearly from a stored start date. This page covers whole-year shifts only. Adding months or days uses other rules, and the result of adding twelve months is not guaranteed to match the result of adding one year in every tool, so check which operation a tool performs.

Leap years in the Gregorian calendar

The Gregorian calendar, introduced by Pope Gregory XIII in 1582, adds a leap day to years divisible by 4, except for century years unless they are also divisible by 400. So 2024 and 2028 are leap years, 2100 is not, and 2000 was. The rule averages 365.2425 days per year, which closely matches the tropical year of about 365.2422 days. The calculator uses these rules to decide whether the target year contains February 29. A date such as 2025-02-29 does not exist, so a shift that lands on it needs a convention. Clamping to February 28 is the convention used here, as the formula states. Between 2000 and 2100 there are 25 leap years, since 2000 and every fourth year through 2096 count, and 2100 does not.

Step one: one year forward

Adding one year to 2024-02-29 targets 2025-02-29. The year 2025 is not a leap year, so the date does not exist, and the calculator returns 2025-02-28. The month stays February and the day moves back by one to the last valid day. The calculator does not record that the original date was a leap day. The output is simply a date, and from this point forward it is an ordinary 28th of February. This single fact explains every difference in the worksheet. The information that the source was a leap day is lost the moment the clamp happens. The clamp is a design decision and not a mathematical necessity, which is why the formula on the page states it outright. A scheduling program that stores only this output has no way to know that the schedule once belonged to a leap day, so the anchor must be stored separately by whoever designs the schedule.

Step two: three more years

Adding three years to 2025-02-28 gives 2028-02-28. The year 2028 is a leap year, and February 29 exists in it, but the source day is the 28th, so the result is the 28th. The calculator shifts the year and keeps the day number, adjusting only when the day cannot exist in the target month. A date on the 28th always exists in February, so no adjustment applies. The two-step path therefore ends at 2028-02-28 after a total shift of four years. The date is valid and correct for the stated steps, and it differs from what a direct shift gives. The sum of the shifts matches the direct path, 1 plus 3 equals 4, and the results still differ. Equal totals of years do not guarantee equal dates once a clamp happens in between.

The direct four-year shift

Adding four years straight to 2024-02-29 gives 2028-02-29. The target year is a leap year, so February 29 exists, and the day is kept. The sequential path ended on the 28th and the direct path ended on the 29th, both after a total of four years. Neither is a calculator error. They come from two different questions: shifting from a leap day to a leap day, versus shifting from a clamped date. If your intent is an anniversary of the original leap-day date, the direct shift from the original anchor is the faithful one. A direct shift treats the original date as the single source of truth, which is the safest habit for recurring events. The elapsed time between the two endpoints is 1,461 days, which is four years of 365 days plus the leap day that falls inside the span. The date in 2028 that completes four years from a leap day is therefore the leap day itself, whenever it exists.

Keeping the anchor date

The remedy is to remember the anchor. When a schedule repeats yearly, compute each occurrence from the original date, adding n years for the nth occurrence, instead of adding one year to the previous result. The sequence then returns to the 29th every fourth year without drifting, as the full schedule at the end of this page shows. Chaining one-year steps from the previous result would stay on the 28th forever once it clamped. Storing the anchor and the count is a small design choice that avoids this drift. In a spreadsheet or database, one column for the anchor and one for the count of years since the anchor makes the rule explicit.

Century boundaries

The century rule produces cases that surprise people. Adding 4 years to 2096-02-29 targets 2100-02-29, but 2100 is not a leap year, so the result is 2100-02-28. Adding 100 years to 2000-02-29 also lands in 2100 and gives 2100-02-28. Adding 100 years to 2024-02-29 targets 2124, which is a leap year, and returns 2124-02-29. A shift of exactly 4 years is therefore not always safe, and a shift of exactly 100 years depends on the starting century. The calculator applies the leap rules each time, so these cases come out right without special handling. The next such skipped leap year is 2100, and anything planned past that date should be checked against the century rule. A subscription that started on 2096-02-29 and renews every four years would therefore skip the leap day in 2100 and renew on the 28th, then return to the 29th in 2104, which is again a leap year, provided each renewal date is computed from the original anchor.

Other clamping targets

Clamping to February 28 is one of several ways to handle a missing date. Some systems roll forward to March 1 instead. Month arithmetic has the same problem with day 31: adding one month to January 31 has no February 31, and libraries disagree on whether to return the last day of February or to carry into March. Each choice is defensible, and none is universal. When a result matters, check which convention your tool uses and state it. This page documents that the calculator clamps backward to the last valid day of the same month. Choosing the earlier day keeps the result in the same month, which matters for reports that group by month.

Legal and contractual dates

How a person born on February 29 reaches an age birthday in nonleap years differs among jurisdictions, with some treating the 28th and others the 1st of March as the date. Contracts that renew annually from a leap day may also specify a rule. The calculator does not decide these questions, and this page describes only its arithmetic. If a date has legal consequences, use the rule written in the governing document, and verify it with the responsible authority. A calendar tool gives a consistent algorithm, and that is not the same as legal advice. Where a contract says nothing, the parties can add a sentence that fixes the rule, for example that annual dates falling on a missing leap day move to the last day of the month. A sentence like that costs little and prevents later argument.

Testing your own cases

A few checks build confidence. Shifting 2024-02-29 by 2 years returns 2026-02-28, because 2026 is not a leap year. Shifting by 8 years returns 2032-02-29, since 2032 is a leap year. Shifting 2000-02-29 by 100 years returns 2100-02-28. If you plan to use results in a schedule, run a few such cases around the dates that matter. Include the next leap year and a century boundary if the range reaches far enough. Write down the expected result before running each case. If the calculator disagrees, work out which of the leap-year rules or the clamp explains the difference, instead of adjusting the expectation to match.

Reading the results

Each result in the worksheet is a calendar date, not a duration. The calculator does not count days or tell you how many days passed. The elapsed time from 2024-02-29 to 2028-02-29 is 1,461 days, one more than four common years because it spans one leap day, and the elapsed time from 2024-02-29 to 2028-02-28 is 1,460 days. The one day gap in dates is a one day gap in elapsed time. Use a date difference calculator when you need counts of days. Dates here are calendar dates without a time or time zone, so no daylight saving or offset question enters the arithmetic.

An annual schedule from a leap-day anchor

Keeping the original date as the anchor gives a stable yearly schedule. Shifting 2024-02-29 by 1 through 8 years gives 2025-02-28, 2026-02-28, 2027-02-28, 2028-02-29, 2029-02-28, 2030-02-28, 2031-02-28 and 2032-02-29. The leap-day occurrences fall in 2028 and 2032, and the other years use the 28th. Building the list this way takes eight separate shifts from one fixed date. Building it by repeatedly adding one year to the previous entry would stay on the 28th after the first clamp and never return to the 29th. The first list reproduces the calendar, and the second drifts permanently.

Reproduce the checks

One year into a nonleap year

Open the Add Years Calculator and enter:

Calendar date
2024-02-29
Years
1

Expected output:

Date

2025-02-28

The destination lacks February twenty-ninth.

Three more years from the intermediate date

Open the Add Years Calculator and enter:

Calendar date
2025-02-28
Years
3

Expected output:

Date

2028-02-28

The source day remains twenty-eight.

Four years from the original date

Open the Add Years Calculator and enter:

Calendar date
2024-02-29
Years
4

Expected output:

Date

2028-02-29

The destination can represent the original day.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks