Date Subtract Calculator

Subtract a number of days, weeks, or months from a date to find an earlier date.

🧮

Enter your values and click Calculate

Working backwards from a known date is a common planning task: a lease ending on June 15 requires 30 days notice, so what is the notice deadline? A product launching November 1 needs a 6-week marketing runway, so when should the campaign begin? A 90-day prescription needs a refill before it runs out, so when did it start? This calculator handles all of these by subtracting any combination of days, weeks, and months from a start date to produce the resulting earlier date. Month subtraction handles year boundaries automatically — subtracting three months from February correctly returns November of the previous year — while the UTC-based arithmetic avoids daylight saving time errors.

How It Works

The start date is first validated with a UTC round-trip check that rejects impossible dates like February 31. Weeks are converted to days (weeks × 7) and added to the day subtraction total. Months are subtracted by passing a negative month offset to JavaScript's Date.UTC() constructor: new Date(Date.UTC(year, month − subtractMonths, day − totalDays)). The Date constructor automatically handles overflow in both directions — subtracting past month 0 rolls back the year, and subtracting past day 1 rolls back the month. The result is formatted as YYYY-MM-DD (ISO 8601) and a human-readable total day count is calculated for reference.

Examples

Subtract 30 days from June 15, 2025
Find a date 30 days before a deadline.
Result: Result: 2025-05-16.
Subtract 3 months and 2 weeks from December 1, 2025
Working backwards for a project start date.
Result: Result: 2025-08-18.
Subtract 6 months from March 31, 2026
Lease notice period calculation crossing a year.
Result: Result: 2025-09-30 (month-end clamped to September's last day).

Frequently Asked Questions

What happens when subtracting months crosses a year boundary?
The calculator handles this automatically — subtracting 3 months from February 2025 correctly returns November 2024. JavaScript's Date constructor manages year rollover when the month index goes below 0.
Can I subtract just weeks or just months?
Yes — leave unused fields at 0. You can subtract any combination of days, weeks, and months independently, and the calculator combines them into a single correct result date.
What if subtracting months produces an invalid day, like February 31?
JavaScript's Date constructor automatically clamps invalid dates to the last valid day of the month. Subtracting one month from March 31 produces February 28 (or 29 in a leap year) rather than an error.

Related Calculators