Date & Time

How to Calculate Days Between Two Dates

How to work out the number of days between two dates by hand or fast. The counting method, worked examples, leap years, and weeks or months between dates.

CE
Calcowa Editorial
Date & Time Calculators Team
Updated 5 min read Reviewed by Calcowa Editorial Team

Counting the days between two dates sounds easy until the span crosses a few months and a leap year sneaks in. This guide shows you the reliable way to do it by hand, walks through worked examples, and covers weeks and months too. For an instant, error-free answer, the days between dates calculator subtracts any two dates for you.

Quick answer

To find the number of days between two dates, give each date its day-of-year number and subtract the earlier from the later: days = day-of-year(end) minus day-of-year(start). Add 365 for every full year in the span, plus one more day for each February 29 it crosses. If you’d rather count by hand, the reliable shortcut is to add three pieces: the days left in the start month, the whole months in between, and the days into the end month. These are calendar days; if you only want working days, see business days vs calendar days.

The method: count in three parts

The trick to counting days across months is to break the span into three easy pieces instead of counting one day at a time.

  1. Days left in the start month after your start date.
  2. Full months in between, added up using each month’s length.
  3. Days into the end month, up to your end date.

Add those three together and you’ve got the total. The only things to watch are that months range from 28 to 31 days, and that February has 29 days in a leap year.

Worked example: within a year

Let’s count the days from March 10 to July 9 in the same year.

  • Days left in March after the 10th: 31 minus 10 = 21
  • Full months in between (April, May, June): 30 + 31 + 30 = 91
  • Days into July: 9
  • Total: 21 + 91 + 9 = 121 days

That’s the whole method. Notice we used each month’s real length rather than assuming 30, which is where hand counts usually go wrong.

Worked example: how many days since

“How many days since” is the same idea, counting from a past date up to today. Say you want the days since January 1 of this year, with today being July 9.

  • Days left in January after the 1st: 31 minus 1 = 30
  • Full months February to June: 28 + 31 + 30 + 31 + 30 = 150
  • Days into July: 9
  • Total: 30 + 150 + 9 = 189 days

If the span crossed February 29 in a leap year, you’d add one more day. This is exactly the kind of place a calculator saves you from a slip.

The formula for days between two dates

If you’d rather use a formula than count month by month, give each date its day-of-year number and subtract:

Days between = day-of-year(end date) minus day-of-year(start date)

To get a date’s day-of-year number, add the running total below to the day of the month.

MonthDays before it (non-leap year)
January0
February31
March59
April90
May120
June151
July181
August212
September243
October273
November304
December334

Take March 10 to July 9 again. March 10 is 59 + 10 = day 69, and July 9 is 181 + 9 = day 190. Subtract: 190 minus 69 = 121 days, the same answer the counting method gave. For dates in different years, add 365 for each full year between them, plus one extra day for every February 29 the span includes. In a leap year, add 1 to every running total from March onward.

Do you count both dates?

This catches people out, so it’s worth being clear. The plain difference between two dates counts the end date but not the start date. That’s what you want for things like “days until” a deadline.

If you need every day counted, including both ends, add one. A hotel stay from the 10th to the 14th spans 4 nights but touches 5 calendar days, so whether you add one depends on what you’re really counting.

Weeks and months between dates

Once you have the days, the rest is easy.

You wantHow to get it
Weeks between datesDays divided by 7 (whole number is weeks, remainder is days)
Months between datesRoughly days divided by 30.4, or count calendar months directly
Years between datesDays divided by 365.25

So 121 days is about 17 weeks (121 divided by 7 is 17 remainder 2), or roughly 4 months. For an exact age or duration in years, months, and days, the age calculator breaks it down precisely.

Common mistakes when counting days

If your total looks off, it’s almost always one of these.

  • Assuming every month has 30 days. They don’t, and that’s the number one slip. You’ve got to use each month’s real length, from 28 up to 31.
  • Forgetting the leap day. If your span crosses February 29, you’ll be one short unless you add it. It’s easy to miss when the years aren’t obvious.
  • Mixing up inclusive and exclusive counts. Decide up front whether you’re counting both ends or not, since that’s a one-day difference every time.
  • Losing track over long spans. The more months you cross, the more chances there are to fumble a number, so it’s worth double-checking with a tool.

None of these are hard on their own, but together they’re why hand counts drift on longer gaps.

When to just use the tool

Hand counting is fine for a few weeks, but months have different lengths and leap years add a day, so long spans get error-prone fast. For anything important, a deadline, a due date, a contract, enter the two dates in the days between dates calculator and let it handle the month lengths and leap years for you. To add or subtract days from a date instead, such as finding a deadline 90 days out, use the date calculator. If you want the calendar background, see how many days are in a year, and for working days only, business days vs calendar days.

Frequently asked questions

Count the days in each full month between the two dates, then add the leftover days at each end, remembering February has 29 days in a leap year. For an exact count without the effort, subtract the two dates in a days between dates calculator.

Count from that past date up to today. For a date earlier this year, add the remaining days of its month, the days in each full month since, and the days so far in the current month. A calculator does it instantly if you enter the start date and today.

It depends on what you need. The plain difference between two dates excludes the start day and counts the end day. If you want every day inclusive, such as the length of a hotel stay or event, add one to the result.

Add up the days remaining in the first month, the full days of every month in between, and the days into the final month. Watch month lengths, since they vary from 28 to 31 days, and add a day for February 29 in a leap year.

Find the number of days between the dates, then divide by 7. The whole number is the weeks, and the remainder is the extra days. So 45 days is 6 weeks and 3 days, because 45 divided by 7 is 6 remainder 3.

Give each date its day-of-year number, then subtract the start from the end: days = day-of-year(end) minus day-of-year(start). You find a date's day-of-year number by adding the days in every month before it to the day of the month. For spans across years, add 365 for each full year, plus one more day for every February 29 the span crosses.

It's the same calculation, counted forward from today. Add the days left in the current month, the whole months in between, and the days into the target month. The plain count leaves out today and includes the target day, which is what you want for a deadline or due date.

Because months have different lengths and leap years add a day, so it's easy to miscount over a long span. That's why subtracting the dates in a calculator is more reliable for anything beyond a few weeks.

CE
Calcowa Editorial
Date & Time Calculators Team

Calcowa's editorial team builds and checks every calculator against published formulas, then writes these guides so the numbers make sense. Each tool shows its formula and a worked example. See our methodology.

Share:

Related guides