TodayMonday, October 5, 2026
Calendar rules · practical guide

Leap Years and Month-End Dates: How Calendar Math Works

Written and maintained by Navjeet Kamboj4 minute readDate and time methods
Navjeet Kamboj
Written and maintained by Navjeet Kamboj
Author & editor · Age Calculator Lab

What this guide covers

Learn the Gregorian leap-year rule and how month-end clamping affects date offsets and anniversaries.

The Gregorian leap-year rule has three tests

A Gregorian year normally contains 365 days. A leap year adds February 29 and contains 366. The rule begins with divisibility by four. Century years require an additional test: a year divisible by 100 is not a leap year unless it is also divisible by 400.

The year 2028 passes the four-year test and is a leap year. The year 2100 fails the century exception and is a common year. The year 2400 passes the 400-year exception and is a leap year. A calculator that adds a leap day every fourth year without checking centuries eventually returns the wrong dates.

The leap year calculator applies all three tests. Its result is computed from the selected year. It does not depend on a list ending at 2027 or a stored calendar for a small set of years.

A calendar month is not a fixed number of days

Calendar months range from 28 to 31 days. Adding 30 days to January 31 therefore asks a different question from adding one month. In a common year one calendar month after January 31 is February 28 under month-end clamping. Thirty days after January 31 is March 2.

The distinction matters for subscription schedules, anniversaries and planning intervals. A task expressed in calendar months usually follows a date anniversary rule. A task expressed in days follows a fixed number of date boundaries.

The date calculator includes separate day, week, month and year units. Choose the unit stated by the schedule. Converting every month to 30 days loses the relationship to the original date.

What month-end clamping means

Clamping preserves the intended target month and uses its last valid day when the original day number does not exist. January 31 plus one month becomes February 28 in a common year. In a leap year it becomes February 29. March 31 plus one month becomes April 30.

This is a stated convention rather than a law governing every contract. Some software rolls an overflow into the following month. A schedule can also specify “the last day of each month” rather than “the same day number.” These choices produce different results near short months.

Start dateChangeClamped result
January 31, 2027Add one monthFebruary 28, 2027
January 31, 2028Add one monthFebruary 29, 2028
February 29, 2028Add one yearFebruary 28, 2029

Repeated month additions can change the anchor

Adding two months in a single operation is not always the same as adding one month twice. Starting January 31, 2027 and adding two months directly reaches March 31. Adding one month first reaches February 28. Adding another month to that intermediate date reaches March 28.

The second calculation has changed its anchor to day 28. A recurring schedule anchored to the original day requires a fresh calculation from the original date for each recurrence. A schedule that advances from the last result follows a different sequence.

This difference is useful when testing a billing or anniversary system. Record whether the recurrence preserves its original anchor. The lab's date offsets are single operations. The anniversary tool calculates the requested anniversary from the original event date.

Complete months use calendar anniversaries

A complete calendar month is reached when the corresponding clamped anniversary is no later than the end date. The interval January 31 to February 28, 2027 completes one month under the lab's convention. The interval January 31 to February 27 does not.

After finding complete months the remaining days are counted from that anniversary to the end date. This produces a calendar period rather than a decimal approximation. The months between dates calculator shows complete months alongside the full calendar-day difference.

For a fixed-duration comparison use the day count. Dividing days by an average month length answers a different statistical question. It does not identify when a particular calendar anniversary occurs.

The calendar system matters for historical dates

The tools apply Gregorian rules consistently. They do not reconstruct every country's historical transition from the Julian calendar. A historical record may use a local calendar system or an old-style date. Entering its visible numbers into a modern Gregorian tool can therefore answer a different question.

For everyday future scheduling this consistent calendar is practical. For historical research identify the system used by the original record before calculating. For official birthday or eligibility rules check whether a leap-day anniversary is treated as February 28 or March 1.

Read birthday and anniversary rules for personal milestones. Use the day-of-year tool to inspect how February 29 changes the ordinal day of dates later in the year.

Check a long year span in Leap Years Between Years, or find the next matching year in the Next Leap Year Calculator. Both keep the Gregorian century exception rather than adding four years unconditionally.

Frequently asked questions

Is 2100 a leap year?

No. It is divisible by 100 but not by 400. February has 28 days in 2100.

Why does adding a month differ from adding 30 days?

A month follows a calendar anniversary. Thirty days follow a fixed number of date boundaries. Month lengths vary.

What happens to February 29 after adding a year?

Under this site's clamping convention the result is February 28 in a common year. A governing rule can require a different convention.

Sources and further reading

These sources explain the calendar, time-zone or published schedule conventions discussed here. Worked examples use the lab's stated calculation rules.

US Naval Observatory: calendars and leap years

Related guides

Keep exploring

View the tool library
Navjeet Kamboj, author at Age Calculator Lab
About the author

Navjeet Kamboj

Author & editor · Age Calculator Lab

Navjeet Kamboj is the author and editor of Age Calculator Lab. He focuses on making age, date, milestone and planning calculations easier to understand through clearly explained methods, practical examples and responsible limitations.