UtilityBase logoUtilityBase

2 min read

How to Add and Subtract Dates

Learn to add or subtract days, weeks, months, and years from a date, count the days between two dates, and handle business days and leap years correctly.

Why Date Math Is Trickier Than It Looks

Adding a fixed number of days to a date sounds trivial, but calendars are irregular. Months have different lengths, leap years insert an extra day every four years with exceptions at century boundaries, and adding months can land you on a date that does not exist, like the 31st in a 30-day month. These edge cases are exactly where manual counting goes wrong.

Whether you are tracking a project deadline, a contract notice period, or a warranty window, doing the arithmetic reliably means letting a tool handle the calendar rules for you.

Two Kinds of Date Calculation

The first kind adds or subtracts a duration from a known date. Starting from today, you might add 90 days to find a deadline, or subtract three months to find when something began. The result is a new date.

The second kind measures the gap between two known dates. Here you already have a start and an end, and you want to know how many days, weeks, or months separate them. This is how you count down to an event or work out how long ago something happened. The two operations are inverses of each other.

Using the Date Calculator

The Date Calculator does both operations and includes a business-days mode that skips weekends, which is useful for deadlines expressed in working days. It runs entirely in your browser, so the dates you enter stay on your device.

  1. 1Open the Date Calculator in your browser.
  2. 2Choose whether to add or subtract a duration, or to measure the gap between two dates.
  3. 3Enter your start date.
  4. 4Type the number of days, weeks, months, or years to apply, or enter a second date.
  5. 5Turn on business-days mode if you want weekends excluded.
  6. 6Read the resulting date or the counted duration.

Business Days Versus Calendar Days

Many real deadlines are stated in business days, meaning weekends do not count. A payment due in ten business days from a Monday lands two weeks later, not ten calendar days later. Business-days mode handles this by counting only Monday through Friday.

Keep in mind that this weekend-skipping does not automatically account for public holidays, which vary by country and region. If a holiday falls inside your window, you may need to extend the result by the relevant number of days for your location.

Handling Months, Years, and Leap Days

Adding months and years introduces its own quirks. Adding one month to January 31 has no exact equivalent in February, so tools typically clamp the result to the last valid day of the target month. Being aware of this convention prevents surprises when a result is a day or two off what you expected.

Leap years matter whenever your span crosses February 29. A one-year span starting on that date has no matching end date in a common year, and day counts across a leap year include the extra day. The calculator applies these rules automatically so you do not have to track them by hand.

Frequently asked questions

How do I count the number of days between two dates?

Choose the mode that measures the gap between two dates, enter both the start and end dates, and the calculator returns the total. You can view the span in days, and often in weeks, months, or years, depending on which unit is most useful for you.

What does business-days mode actually do?

It counts only Monday through Friday and skips Saturdays and Sundays. This matches deadlines written in working days. It does not automatically remove public holidays, which differ by region, so add those manually if one falls inside your date range.

What happens when I add a month to the 31st?

If the target month has no 31st, the result is clamped to the last valid day of that month. Adding one month to January 31 typically yields February 28, or February 29 in a leap year. This convention keeps results on real calendar dates.

Tools mentioned in this guide

Keep reading