Everyday Tools

Date Calculator

Add or subtract years, months, and days, and count the days between two dates, including leap years.

Date Calculator workspace

How to use it

Pick a start date. Enter years, months, and days to add. Negative numbers subtract. Add or subtract shows the result and says when the day was clamped to the end of a shorter month. Difference uses the start and end dates and reports the number of days and the direction.

Example

January 31 plus one month in 2024 lands on February 29 because 2024 is a leap year. The same step in 2023 lands on February 28.

Input

2024-01-31

Result

2024-02-29 (clamped to the last valid day of the month)

How it works

Months are added before days. If the day does not exist in the destination month, it is clamped to the last valid day. February 29 exists only in leap years. The Gregorian rules are the usual ones: a year divisible by 4 is a leap year, except centuries, which must be divisible by 400. Dates use the calendar date only, with no time zone shift.

Common errors

  • February 29 was rejected That year is not a leap year. Choose February 28 or a leap year.
  • January 31 plus one month did not become March 3 This calculator clamps to the last valid day instead of rolling into the next month. The result says when it clamps.
  • The year is out of range Results must stay inside year 1 through 9999.

Limitations

The difference is a whole number of calendar days, not business days. Holidays and work weeks are not removed. Adding months does not preserve a time of day because the inputs are dates.

Privacy

The text you paste is processed in your browser. PepsTools does not receive it, store it, or send it to another service.

Questions

What is 2024-02-29 plus one year?

2025-02-28. The day is clamped because 2025 is not a leap year. Plus four years returns 2028-02-29.