Date Calculator

Add or subtract days, months, and years from any date. Returns the resulting date in long form and ISO 8601, the day of the week, and the total day shift.

#time-and-date#dates#calendar#add-days

Use a negative number to subtract

Use a negative number to subtract

Use a negative number to subtract

Resulting date

25 July 2026 (Saturday)

ISO 8601
2026-07-25
Day of week
Saturday
Total days from start
+191 days later
Starting date
2026-01-15

Year offset applied first, then months (anchored to the start day-of-month, clamped at month length), then days. Calendar arithmetic on the proleptic Gregorian calendar in UTC.

How to use this calculator

Pick a starting year, month, and day. Then enter how many years, months, and days to add — use negative numbers in any field to subtract. The calculator returns the resulting date in long form (e.g. "25 July 2024") and ISO 8601 (e.g. "2024-07-25"), the day of the week, and how many calendar days the result is from the starting date.

How the calculation works

Three offsets are applied in order. First, the year offset shifts the year. Second, the month offset shifts the month, anchoring the day-of-month to the original — if the target month is shorter than the anchor day, the result is clamped to the last day of that month (so 31 January + 1 month = 28 or 29 February, not 3 March). Finally, the day offset adds raw calendar days, rolling over months and years as needed. All arithmetic uses the proleptic Gregorian calendar in UTC, so daylight-saving and timezone offsets never shift the result.

Worked example

15 January 2024 + 0 years, 6 months, 10 days. First add 6 months to 15 January: 15 July 2024 (the day-of-month stays the same because July has at least 15 days). Then add 10 days: 25 July 2024, which is a Thursday. The total day shift is +192 days. For a clamping example: 31 January 2024 + 1 month gives 29 February 2024 (a leap year), because February only has 29 days that year.

Frequently asked questions

How do I subtract a date instead of adding?

Type a negative number into any of the years, months, or days fields. For example, to find the date 90 days before 1 June 2026, enter that date as the start, then set days to -90 (leaving years and months at 0). The calculator returns 3 March 2026. You can mix positive and negative offsets — say, -1 year and +30 days — and the calculator handles the sign on each independently.

What happens when I add a month to 31 January?

You get 28 February in a common year or 29 February in a leap year. This is "month anchoring with end-of-month clamping" and it is how PHP DateInterval, date-fns, dayjs, and Wolfram Alpha all handle the case. The logic is: try to keep the day-of-month the same (the 31st), but if the target month does not have that many days, clamp to the last day of the target month. The same applies to 31 March + 1 month = 30 April, and 31 May + 6 months = 30 November.

In what order are years, months, and days applied?

Years first, then months, then days. The order matters when the intermediate result hits a short month. For example, 31 January + 1 month + 1 day applied in order gives 29 February (clamp), then + 1 day = 1 March. Applied in the reverse order (days first), you would get 1 February + 1 month = 1 March — the same answer here, but not always. Order-of-operations matches the convention used by every major date library.

Does the calculator handle leap years correctly?

Yes. The proleptic Gregorian calendar is used throughout: a year is a leap year if it is divisible by 4, except for century years, which must also be divisible by 400. So 2000 and 2024 are leap years, but 1900 and 2100 are not. When you add a year to 29 February in a leap year, the result clamps to 28 February in a common year (e.g. 29 Feb 2024 + 1 year = 28 Feb 2025). Adding 4 years from 29 Feb 2024 lands on 29 Feb 2028, the next leap day.

Why does the calculator use UTC?

Calendar dates are timezone-agnostic — "25 July 2024" is the same date in London, New York, and Tokyo — but a naive JavaScript Date can shift across the daylight-saving boundary if you live in a timezone where the clock changes. By performing all arithmetic in UTC, the calculator avoids that pitfall. Whatever timezone you are in, "15 January 2024 + 10 days" always returns 25 January 2024.

How far back or forward can it calculate?

Years 1 to 9999 inclusive, which covers every realistic use case for historical research, project planning, demographic work, and contract dates. The underlying engine is JavaScript's Date object, which can in principle reach hundreds of thousands of years in either direction, but the calculator caps year input at 9999 (four digits) for consistency with ISO 8601 short form. If you need an earlier or later year, you can extend the cap by editing the start-year field directly — the math still works.