Skip to content
Everyday Utilities Free • No signup • Instant results

Add or Subtract Date

Add or subtract days, weeks, months or years from any date.

About the Add or Subtract Date

The Date Add/Subtract Calculator shifts a starting date by a specified number of days, weeks, months, or years — in either direction. Use it to compute due dates (invoice net-30, library loan periods, project deadlines), contract renewal dates, prescription refill schedules, anniversary reminders, or any other date arithmetic that requires adding or subtracting a time interval from a known date.

Date arithmetic sounds trivial but has subtle traps. Adding one month to January 31 should give February 28 (or 29 in a leap year), not March 3. Adding one year to February 29, 2024 should give February 28, 2025, not March 1. The calculator uses JavaScript’s Date object methods, which handle these edge cases correctly by clamping to the last valid day of the target month.

The result panel shows the original date, the operation performed, the result date, the day of the week, and the net change in days. The net change is useful when adding months or years — you can see that adding 3 months to January 31 gives April 30, which is 90 days (not 91 as a naive 30 × 3 calculation would suggest).

How It Works

The calculator uses four JavaScript Date methods, one per unit:

  • Days: result.setDate(date.getDate() + n). The setDate method handles overflow and underflow automatically: setDate(35) on a January date rolls over to early February; setDate(-5) rolls back to late December of the previous year.
  • Weeks: Same as days, multiplied by 7: setDate(date.getDate() + n * 7).
  • Months: result.setMonth(date.getMonth() + n). This handles year rollover automatically: adding 13 months to a January date lands in February of the next year. The catch is what happens when the target month has fewer days than the start: adding 1 month to January 31 lands in March 3 (since February has at most 29 days), but the standard convention is to clamp to the last day of the target month — February 28 (or 29). The calculator does this clamping explicitly by checking if the resulting day is different from the original and adjusting.
  • Years: result.setFullYear(date.getFullYear() + n). Similar to months, this handles the February 29 edge case by clamping to February 28 in non-leap target years.

The clamp-to-last-day logic is critical for legal and contractual date arithmetic. The Uniform Commercial Code (UCC) and most jurisdictions specify that when a deadline computed by adding months falls on a day that does not exist in the target month (e.g., February 30), the deadline is the last day of that month (February 28 or 29). The calculator implements this convention.

The net-days-change is computed by subtracting the original date from the result and dividing by 86,400,000 ms/day. This shows the actual elapsed time, which may differ from a naive multiplication (e.g., adding 3 months results in 89-92 days depending on which months are crossed).

Worked Examples

Starting from June 15, 2024, adding 90 days gives September 13, 2024 — a Friday. This is the standard net-90 invoice due date convention. The net change is exactly 90 days, as expected for a days-based addition.

Starting from January 31, 2024, adding 1 month gives February 29, 2024 — not March 3. The clamp logic kicks in because February 2024 has only 29 days (it is a leap year). The net change is 29 days, not the 30 or 31 a naive month-add might suggest.

Starting from January 31, 2024, adding 1 month in a non-leap year (try January 31, 2023) gives February 28, 2023. The clamp sets the day to 28 (the last day of February 2023).

Starting from February 29, 2024 (leap day), adding 1 year gives February 28, 2025 — not February 29 or March 1. The standard convention is to clamp to February 28 in non-leap target years. Adding 4 years gives February 29, 2028 — the next leap day.

For an anniversary reminder: starting from your wedding date (June 15, 2020), adding 5 years gives June 15, 2025. Adding 10 years gives June 15, 2030. The day of week shifts (Sunday in 2025, Saturday in 2030) because the year length is 365 days (52 weeks + 1 day) or 366 in leap years.

When to Use This Tool

  • Computing invoice due dates for net-30, net-60, and net-90 payment terms.
  • Scheduling prescription refills (e.g., add 90 days for a 3-month supply).
  • Calculating contract renewal dates and notice periods for lease or service agreements.
  • Determining project deadlines by adding development time to a start date.
  • Computing anniversary dates (birthdays, wedding anniversaries, work anniversaries) for the next N years.
  • Determining eligibility windows (e.g., 6 months from date of hire to qualify for benefits).
  • Tracking court filing deadlines and statutory waiting periods.

Limitations & Disclaimer

This calculator uses JavaScript’s Date object methods (setDate, setMonth, setFullYear) which handle overflow and clamp-to-last-day automatically. The clamp convention (January 31 + 1 month = February 28) matches the Uniform Commercial Code and most legal date arithmetic conventions, but may differ from specific contractual language — always verify against the actual contract. The calculator works in your browser’s local time zone and uses midnight as the time component; time-of-day-specific calculations (e.g., 90-day notice at 5:00 PM) are not supported. The maximum amount is 100,000 units; for larger intervals use a dedicated date library. For dates before 1582 (Gregorian calendar introduction), results are nominal and may not match historical records. See our disclaimer for full terms.

Frequently Asked Questions

What happens when adding a month to January 31?

The result is February 28 (or 29 in a leap year). JavaScript&rsquo;s <code>setMonth</code> would normally produce March 3 (overflowing past February), but the calculator clamps to the last valid day of the target month. This matches the Uniform Commercial Code and most legal conventions.

How does the calculator handle February 29?

Adding 1 year to February 29, 2024 gives February 28, 2025 (clamp to last day of February in non-leap year). Adding 4 years gives February 29, 2028 (the next leap day). Subtracting 1 year from February 29, 2024 gives February 28, 2023.

What is the maximum amount I can add or subtract?

Up to 100,000 in any unit. That is 100,000 days (~274 years), 100,000 weeks (~1,917 years), 100,000 months (~8,333 years), or 100,000 years. Beyond these limits, JavaScript&rsquo;s Date object (which uses 64-bit milliseconds since the Unix epoch) becomes unreliable.

Does the calculator handle BCE (BC) dates?

No. JavaScript&rsquo;s Date object technically supports dates back to year 1 AD, but the calculator restricts input to dates that the browser&rsquo;s native date picker can produce. For historical or astronomical date arithmetic, use a dedicated library like <code>moment.js</code> (deprecated), <code>date-fns</code>, or the JSR-310-style <code>temporal</code> proposal.

How is the day of the week calculated for the result?

JavaScript&rsquo;s <code>Date.getDay()</code> returns 0 (Sunday) through 6 (Saturday) based on the local time zone. The calculator maps this to the day name (Sunday, Monday, ..., Saturday). The day of the week shifts forward by 1 each common year (365 days = 52 weeks + 1 day) and 2 each leap year.

Can I subtract days to get a past date?

Yes &mdash; set the operation to &ldquo;Subtract&rdquo; and enter the amount to subtract. The result is the starting date moved backward by the specified amount. Subtracting 90 days from June 15, 2024 gives March 17, 2024. The same logic applies to weeks, months, and years.

Last updated: July 21, 2026  ·  Author: HT99 Tools Editorial Team  ·  Reviewed by: HT99 Tools Editorial Team