Date & Time

How to Add or Subtract Days From a Date

How to add and subtract days, weeks, months and years from any date, why month ends and leap years cause surprises, and how business-day counting works.

2 min read·Updated 2026-07-09

Adding a number of days to a date looks trivial until you hit a month boundary, a leap year or a loan that only counts business days. This guide covers the straightforward arithmetic and the edge cases that cause off-by-one mistakes in spreadsheets and code alike.

Days, weeks, months and years

  • Days and weeks — simple. Add or subtract the count. A week is just 7 days, so 3 weeks is 21 days.
  • Months — not a fixed length. Adding one month means advancing to the same day number in the next month when possible.
  • Years — usually 365 or 366 days, so adding one year can shift the weekday.

The number of days between two dates varies with the calendar, which is why a date calculator is more reliable than mental math.

The month-end rollover problem

Add one month to 31 January and there is no 31 February. Most libraries roll forward to 28 or 29 February, but some clamp to the last valid day, and a few produce an invalid date. Add one month to 31 March and you land on 30 April. These differences matter for billing cycles: a subscription charged on the 31st may reset to the 28th in a short month and never recover unless the system is designed to track the original day.

Leap years

RuleExample
Divisible by 42024 is a leap year
Except divisible by 1002100 is not a leap year
Unless divisible by 4002000 is a leap year

Adding 365 days is not the same as adding one year whenever a 29 February falls in the range. Over a century, ignoring leap years would drift a calendar by about 24 days.

Business-day calculations

Contracts, shipping estimates and payroll often count only Mondays through Fridays, excluding weekends and public holidays. Adding 10 business days from a Friday lands two calendar weeks and a weekend later, not 10 calendar days. Holiday lists differ by country and region, so a business-day calculator needs the right calendar to be accurate. For plain calendar math, use the Date Calculator (Add / Subtract); to measure the gap between two dates, the Date Difference Calculator; and for working days only, the Business Days Calculator.

Frequently asked questions

Does adding days change the time of day? Pure date arithmetic usually keeps midnight, while timestamp arithmetic carries the time along, so a DST change can shift the clock by an hour.

How do I add a period and then subtract it to get back? Do not assume it rounds back, because clamping at month ends is not reversible. 31 Jan plus a month then minus a month often returns 28 or 29 Feb.

Are weekends always Saturday and Sunday? In much of the world, yes, but many countries use Friday and Saturday, so business-day tools must let you set the weekend.

Tools used in this guide

Related guides