Date Calculator

Count the days between two dates, or add and subtract days, weeks, months or years from any date. The date difference also comes as years, months and days, as weeks, and as US business days; the answer updates as you type, and you can copy a link to share the exact calculation.

Pick a start date and a whole number.

How to use the date calculator

  1. 1

    Pick a mode

    Choose "Add or subtract" to move from a date, or "Days between dates" to measure a span.

  2. 2

    Enter the dates

    Pick the start date, then the amount and unit, or the end date. Today is filled in for you.

  3. 3

    Read the answer

    The result updates as you type. Copy the link to share or save the calculation.

How DateMath calculates dates

DateMath counts the days between two dates as their difference: the days after the start date up to and including the end date, or both ends when you tick the box. To add months or years, DateMath keeps the day number and moves to the last day of the month when that day doesn't exist. Days and weeks are exact counts, weekends included, and a week is always 7 days.

  • The Gregorian calendar. DateMath treats every date as a Gregorian date, with its leap-year rule: a year divisible by 4 is a leap year, except century years not divisible by 400, so 2000 had a February 29 and 2100 will not. Source: Gregorian calendar.
  • US federal holidays. DateMath skips the 11 annual holidays of 5 U.S.C. 6103 on the days they are observed for federal employees, as the US Office of Personnel Management (OPM) lists them: a Saturday holiday on the Friday before, a Sunday holiday on the Monday after. Source: 5 U.S.C. 6103, OPM federal holidays.

DateMath's date math is tested against more than 100 cases worked out by hand. Every worked example and table on the site is computed with the same code the calculators run, so a page and its calculator can't disagree.

Add or subtract days, weeks, months and years from a date

To add days to a date, open the "Add or subtract" tab, pick the start date, choose Add (+), type the number and keep the unit on Days: the new date appears at once, with its weekday. This free online date calculator works the same way for weeks, months and years, and Subtract (−) counts backward instead. The calculation runs in your browser, so the answer changes as you type.

Add days to a date

Days are added one calendar day at a time, so a date plus days lands where you would end up counting squares on a wall calendar, across month ends, year ends and February 29 in a leap year. Weekends count like any other day. A week is always 7 days, so adding 6 weeks gives the same date as adding 42 days. To skip weekends and holidays while adding, use the business days calculator, which adds business days instead.

Under the headline date, the result shows three more lines: the date in ISO format (YYYY-MM-DD, the form spreadsheets and many forms expect), the calendar days from the start date, and the day of the year with its ISO week number. The calendar-days line is the quick way to turn months or years into days: add 3 months and it shows how many days that is from your start date. For the week number on its own, or the dates of a given week, use the week number calculator.

Add months or years

Months and years move by calendar months, not by a fixed number of days. One month after the 15th is the 15th of the next month, whether that is 28, 29, 30 or 31 days later. When the day number does not exist in the target month, the result is that month's last day: January 31, 2027 plus 1 month is February 28, 2027. A year is 12 months, so 1 year after February 29, 2028 is February 28, 2029. The month-end table further down shows more of these cases.

Subtract days, weeks, months or years

Choose Subtract (−) to count backward: the date 30 days before a deadline, or the start of a period that ends on a known date. The same rules apply in reverse, so May 31, 2027 minus 3 months is February 28, 2027. The "Calendar days from the start" line is then negative, showing how far back the result is.

Find the end date from a start date and a duration

To go from a start date to an end date, enter the start date and add the duration in the unit it is given in: a 90-day period in days, a 6-month lease in months, a 2-year term in years. The result is the date exactly that long after the start. If the period counts the start date as day 1, its last day is one day earlier: day 10 of a period that starts on March 1, 2027 is March 10, 2027, while adding 10 days gives March 11, 2027. Deadlines written as "within 30 days of" an event usually leave out the day of the event itself, which is how the calculator counts; when a rule says otherwise, adjust by one day.

Adding and subtracting dates: examples

Months and years move to the same day number; when that day does not exist, the result is the last day of the month.

  • 90 days after January 1, 2027Thursday, April 1, 2027
  • 30 days before January 1, 2027Wednesday, December 2, 2026
  • 6 weeks after March 15, 2027Monday, April 26, 2027
  • 12 weeks before September 1, 2027Wednesday, June 9, 2027
  • 6 months after August 31, 2027Tuesday, February 29, 2028
  • 3 months before October 15, 2027Thursday, July 15, 2027
  • 18 months after June 30, 2027Saturday, December 30, 2028
  • 1 year after February 29, 2028Wednesday, February 28, 2029
  • 10 years after May 20, 2027Wednesday, May 20, 2037

How many days are between two dates?

Subtract the earlier date from the later one. In the "Days between dates" tab, pick a start date and an end date, and the headline shows the date difference in days: the days after the start date up to and including the end date. January 1, 2027 to December 31, 2027 is therefore 364 days. If the end date is before the start date, the count is negative and a note says so. Under the headline, three lines break the same span down: years, months and days; weeks and days; and business days.

Counting both the start and the end date

Tick "Count both the start and the end date (adds 1 day)" when every day in the range counts as a whole day, such as the days of a trip, a course or a leave that runs from a first to a last day. Leave it unticked for durations, deadlines, the nights of a stay and anything measured from one date to another. The checkbox changes every line of the result: the day total, the years, months and days, the weeks, and the business days, which then include the start date when it is a business day. Most one-day disagreements between date calculators come down to this choice.

Days and business days between two dates, with and without counting both dates
DatesDaysDays, both countedBusiness daysBusiness days, both counted
March 1, 2027 to March 5, 20274545
June 1, 2027 to June 30, 202729302021
November 22, 2027 to November 29, 20277845
December 20, 2027 to January 3, 2028141589
January 1, 2027 to December 31, 2027364365249249

Years and months between dates

The "Years, months, days" line answers how many years or months are between two dates. DateMath counts the most whole calendar months that fit, shows each 12 of them as a year, and gives the rest in days. It uses the same month-end rule as adding, so adding the result back to the start date always lands on the end date. For a total in months, multiply the years by 12 and add the months.

The difference between two dates in years, months and days
DatesYears, months, daysDays
January 15, 2027 to March 15, 20272 months59 days
March 15, 2027 to August 2, 20292 years, 4 months, 18 days871 days
September 1, 2027 to June 15, 20289 months, 14 days288 days
January 31, 2027 to February 28, 20271 month28 days
February 28, 2027 to March 31, 20271 month, 3 days31 days
February 29, 2028 to February 28, 20291 year365 days

Month ends follow from the adding rule. January 31, 2027 to February 28, 2027 is 1 month, because 1 month after January 31 is February 28, 2027. February 28, 2027 to March 31, 2027 is 1 month, 3 days, because 1 month after February 28 is March 28, 2027. For ages and birthdays, the age calculator gives the same breakdown with the next birthday; for spans with times of day, the date duration calculator adds hours and minutes.

Weeks between dates

The "Weeks and days" line divides the day count by 7: whole weeks first, then the days left over. It is the quick answer to "how many weeks until" a date, and it follows the checkbox, so a 14-day trip counted from its first to its last day shows as exactly 2 weeks.

Business days between two dates

The last line counts business days: Monday to Friday, without the 11 US federal holidays on the days they are observed. A holiday that falls on a Saturday is skipped on the Friday before, one that falls on a Sunday on the Monday after. Without the checkbox the count starts the day after the start date, the way a "within 10 business days" deadline counts; with it, the start date counts too, which matches Excel's NETWORKDAYS. Ranges longer than 100 years are not counted.

For example, from November 21, 2027 to January 2, 2028 the calculator looks at 42 days. 12 of them are weekend days, and these weekday holidays are left out:

  • Thanksgiving Day, observed on Thursday, November 25, 2027
  • Christmas Day, observed on Friday, December 24, 2027
  • New Year's Day, observed on Friday, December 31, 2027

That leaves 27 business days. State, local and company holidays are not included. To add business days to a date, count weekdays only, or see which holidays were skipped, use the business days calculator.

Days between dates: examples

The day count is the difference between the dates; business days leave out weekends and US federal holidays.

  • December 1, 2026 to December 25, 202624 days (17 business days)
  • February 1, 2027 to March 1, 202728 days (19 business days)
  • June 1, 2027 to September 1, 202792 days (64 business days)
  • September 1, 2027 to June 15, 2028288 days (197 business days)
  • January 1, 2027 to January 1, 2028365 days (249 business days)
  • January 1, 2027 to January 1, 20301,096 days (749 business days)

How to find the halfway date between two dates

Count the days between the two dates, halve the count, and add that many days to the start date. The calculator has no separate halfway mode, but its two tabs do it in three steps:

  1. In "Days between dates", enter both dates and read the day count, with the checkbox unticked.
  2. Divide the count by 2.
  3. In "Add or subtract", enter the start date, choose Add and enter the half count in days.

For example, March 1, 2027 to August 15, 2027 is 167 days. Half of that is 83.5 days, so the middle falls between two days: Sunday, May 23, 2027 and Monday, May 24, 2027 are equally close to it. Leave the checkbox unticked even when both the first and the last day count: the middle of a period is the same either way.

Month ends, leap years and other edge cases

Days and weeks are fixed lengths, so adding them never needs a rule. Months and years are not, and that is where date calculators can disagree. These are the rules this one follows.

The month-end rule

When you add months or years and the start day does not exist in the target month, the result is the last day of that month. Spreadsheet functions such as Excel's EDATE use the same rule. The rule keeps the day number; it does not track "the last day of the month", so 1 month after February 28, 2027 is March 28, 2027, not March 31.

Adding and subtracting months and years at month ends
Start dateChangeResultCalendar days
January 31, 2027Add 1 monthFebruary 28, 202728 days
January 31, 2028Add 1 monthFebruary 29, 202829 days
March 31, 2027Add 1 monthApril 30, 202730 days
August 31, 2027Add 6 monthsFebruary 29, 2028182 days
May 31, 2027Subtract 3 monthsFebruary 28, 202792 days
February 29, 2028Add 1 yearFebruary 28, 2029365 days
February 29, 2028Add 4 yearsFebruary 29, 20321,461 days

It also means a month step is not always undone by the opposite step: January 31, 2027 plus 1 month is February 28, 2027, and that date minus 1 month is January 28, 2027. To get back to the original date, calculate from it again rather than from the result, or work in days.

Leap years

A leap year has 366 days, with February 29. In the Gregorian calendar a year divisible by 4 is a leap year, except century years, which are leap years only when divisible by 400. The calculator applies this rule to every date, so counts across February are exact: February 1, 2027 to March 1, 2027 is 28 days, February 1, 2028 to March 1, 2028 is 29 days. Leap years from 2024 to 2040: 2024, 2028, 2032, 2036, 2040.

The leap-year rule, year by year
YearLeap yearDays in the yearDays in February
1900No36528
2000Yes36629
2024Yes36629
2027No36528
2100No36528

Why 4 weeks is not 1 month

4 weeks is always 28 days; 1 month is 28 to 31 days, depending on the start date. From January 1, 2027, 4 weeks reaches January 29, 2027 and 1 month reaches February 1, 2027. The same holds for years: 52 weeks is 364 days, one day short of a common year and two short of a leap year. When a contract or a rule says "months", add months; when it says "weeks" or "days", add those.

Limits

  • Dates run from the year 1 to 9999; a result outside that range is reported instead of shown.
  • Amounts are whole numbers. For a month and a half, add 1 month and then 15 days in a second step, or use weeks or days.
  • Dates are plain calendar dates without time zones. To add hours and minutes, use the time calculator.
  • Business days are counted for ranges up to 100 years.

Converting days to months and months to days

A span in days turns into months only from a given start date, because months differ in length. The calculator converts both ways: add months in "Add or subtract" and read "Calendar days from the start" for days, or enter both dates in "Days between dates" and read "Years, months, days" for months. Rules of thumb such as 30 days to a month drift: 180 days from January 1, 2027 is 5 months, 29 days, not 6 months.

How many days a number of months is, over every start date from 2027 to 2030
MonthsCalendar daysFrom January 1, 2027
1 month28 to 3131 days
2 months59 to 6259 days
3 months89 to 9290 days
6 months181 to 184181 days
9 months273 to 276273 days
12 months365 to 366365 days
18 months546 to 550547 days
24 months730 to 731731 days
Days as years, months and days, counted from January 1, 2027
DaysYears, months, daysWeeks and daysEnd date
30 days30 days4 weeks, 2 daysJanuary 31, 2027
60 days2 months, 1 day8 weeks, 4 daysMarch 2, 2027
90 days3 months12 weeks, 6 daysApril 1, 2027
180 days5 months, 29 days25 weeks, 5 daysJune 30, 2027
365 days1 year52 weeks, 1 dayJanuary 1, 2028
500 days1 year, 4 months, 14 days71 weeks, 3 daysMay 15, 2028
1,000 days2 years, 8 months, 26 days142 weeks, 6 daysSeptember 27, 2029

Quick-reference tables

Days after and before a date

The dates a common number of days after and before January 1, 2027, weekends and holidays included. For any other start date, enter it in the calculator.

Days from January 1, 2027
DaysAfterBefore
7 daysFriday, January 8, 2027Friday, December 25, 2026
14 daysFriday, January 15, 2027Friday, December 18, 2026
30 daysSunday, January 31, 2027Wednesday, December 2, 2026
45 daysMonday, February 15, 2027Tuesday, November 17, 2026
60 daysTuesday, March 2, 2027Monday, November 2, 2026
90 daysThursday, April 1, 2027Saturday, October 3, 2026
100 daysSunday, April 11, 2027Wednesday, September 23, 2026
120 daysSaturday, May 1, 2027Thursday, September 3, 2026
180 daysWednesday, June 30, 2027Sunday, July 5, 2026
270 daysTuesday, September 28, 2027Monday, April 6, 2026
365 daysSaturday, January 1, 2028Thursday, January 1, 2026

Days in each month

February is the only month whose length changes. From March on, every day of a leap year has a day-of-year number one higher than the same date in a common year.

Month lengths in 2027 and 2028
MonthDays in 2027Days in 2028Day of the year on the 1st, 2027
January31311
February282932
March313160
April303091
May3131121
June3030152
July3131182
August3131213
September3030244
October3131274
November3030305
December3131335

Date calculations in Excel and Google Sheets

Spreadsheets store dates as day numbers, so the same calculations are short formulas. With the start date in A2 and the end date in B2:

  • Days between dates: =B2-A2 or =DAYS(B2, A2) gives the same count as the calculator without the checkbox; add 1 to count both dates.
  • Add days or weeks: =A2+90 adds 90 days, =A2+7*6 adds 6 weeks.
  • Add months or years: =EDATE(A2, 6) adds 6 months and =EDATE(A2, 12*2) adds 2 years, with the same month-end rule as the calculator. Format the cell as a date to see the result as one.
  • Years and months between dates:=DATEDIF(A2, B2, "Y") gives whole years, "YM" the months after them and "MD" the days. The results can differ from the calculator's around month ends, and Microsoft advises against the "MD" unit because it can return wrong results.
  • Business days: =NETWORKDAYS(A2, B2, holidays) counts the weekdays from the start date to the end date, both included, and skips only the holidays listed in the holidays range. With the observed US federal holidays in that range, it matches the calculator with the checkbox ticked.

What people use a date calculator for

  • Deadlines and notice periods."Within 30 days" or "60 days' notice": add the days to the date of the notice or event. When the deadline is in business days, use the business days calculator.
  • Contract, lease and subscription terms. Terms in months or years: add months, and the month-end rule shows where a term that starts on the 29th, 30th or 31st ends.
  • Return windows, trials and warranties. A 30-day return window or a 1-year warranty: add the period to the purchase date.
  • Invoices. Net 30 terms make payment due 30 days after the invoice date: add 30 days.
  • Countdowns. Days until an event: "Days between dates" opens with today as the start, so enter the event date and read the days, or the weeks and days.
  • Looking back. How long ago something happened: enter the past date as the start and today as the end.
  • Trips, leave and events. The number of days from the first to the last day: tick the box to count both dates.
  • Project schedules. Milestones a number of weeks apart: add weeks, and read the ISO week in the result for planning boards that work in week numbers.

Every calculation can be saved or shared with "Copy a link to this calculation": the link opens the calculator with the same dates and settings filled in.

Frequently asked questions

How do I calculate the date difference between two dates?
Subtract the earlier date from the later one: open "Days between dates", pick both dates and the calculator shows the number of days. It counts the days after the start date up to and including the end date, which is the same as the difference between the two dates. Tick "Count both the start and the end date" to add the start day as well, for example when both days of an event count.
How do I add days to a date?
Open "Add or subtract", pick the start date, choose Add (+), type the number of days and keep the unit on Days; the new date appears with its weekday. Every calendar day counts, weekends included, so 90 days after January 1, 2027 is April 1, 2027. Choose Subtract (−) to count back instead.
How do I find a start date from an end date and a duration?
Subtract the duration from the end date: in "Add or subtract", enter the end date as the start date, choose Subtract (−) and enter the amount and unit. For example, 30 days before March 31 is March 1.
How many years and months are between two dates?
Read the "Years, months, days" line under the day count in "Days between dates". It gives the whole years, then the whole months, then the remaining days, so January 15 to March 15 is exactly 2 months. For a total in months, multiply the years by 12 and add the months.
How many days are 3 months or 6 months?
It depends on the start date: 3 months is 89 to 92 days and 6 months is 181 to 184 days. Add the months in "Add or subtract" and the "Calendar days from the start" line shows the exact number for your date.
What happens when I add a month to January 31?
You get the last day of February: February 28, or February 29 in a leap year. When the target month is shorter than the start day, the date is moved to the last day of that month. Spreadsheet functions such as Excel's EDATE follow the same rule.
Is adding 4 weeks the same as adding 1 month?
No. 4 weeks is always 28 days, while 1 month moves to the same day number in the next month, which is 28 to 31 days later depending on the month.
When should I count both the start and the end date?
When every day from the first to the last counts as a whole day, such as the days of a trip, a course or a leave. Leave the box unticked for spans measured from one date to another, such as deadlines, durations or the nights of a stay. Ticking it adds exactly 1 day, so June 1 to June 30 becomes 30 days instead of 29.
How do I find the halfway date between two dates?
Count the days between the dates, halve the count, and add that many days to the start date. Use "Days between dates" for the count and "Add or subtract" for the last step. When the count is odd, the middle falls between two days, so pick the one you prefer.
Does the calculator count leap years?
Yes. It uses the Gregorian calendar, so February has 29 days in years divisible by 4, except century years that are not divisible by 400 (2000 was a leap year, 2100 will not be).
Which business days does the date calculator count?
Monday to Friday, minus the US federal holidays on the days they are observed. For other options, such as counting weekdays only or adding business days to a date, use the business days calculator.

More date and time tools