Free Online Calc

How to calculate the number of days between two calendar dates

Be the first to rate this page.

The number of days between two calendar dates equals each date’s position in a continuous day count, subtracted. From 14 March 2025 to 2 September 2025 is 172 days, found by converting both dates to a day-of-year number, 73 and 245, and subtracting. Crossing a leap year changes the count because February gains a day.

What is the day count between two real calendar dates?

2025 is not a leap year. 14 March is day 73 of the year: 31 (January) + 28 (February) + 14 = 73. 2 September is day 245: 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 2 = 245. Subtracting gives 245 − 73 = 172 days. Compare a span that crosses 29 February: 1 February 2024 to 1 March 2024 is 29 days, because 2024 is a leap year, while 1 February 2025 to 1 March 2025 is only 28 days in the same calendar position.

How do I convert a date to a day-of-year number?

Convert each date to a day-of-year number by adding the days in every whole month before it to the day-of-month, using 29 for February only in a leap year. Subtract the earlier day-of-year number from the later one when both dates fall in the same calendar year; when they fall in different years, add the total days in every whole year between them before subtracting. The date difference calculator performs the subtraction once day numbers are known.

How do I check a day-of-year calculation?

A leap year in the Gregorian calendar is a year divisible by 4, except a century year not divisible by 400, so 2024 and 2028 are leap years while 2100 will not be. Check whether the span crosses 29 February in a leap year before assuming a fixed 365-day year. A short manual count of a nearby familiar interval, such as one calendar month, is a fast way to catch a wrong day-of-year figure.

What mistakes produce a wrong day count?

Do not assume every year has 365 days when a span crosses a leap February. Do not confuse a day-of-year number with a day-of-month number; 2 September is day 245 of the year, not the 245th of September. Do not silently add or drop 1 day without deciding whether the count should include the start date, the end date, both, or neither; that separate choice is explained in the inclusive-versus-exclusive counting guide.

When does this day-count method not apply?

This method counts calendar days on the Gregorian calendar; it does not compute business days, apply a location’s public holidays, or account for a historical calendar change. It also does not measure elapsed clock time when both dates carry a time of day, which needs the separate method in the add-days guide or a full timestamp calculation.

Source for the external fact

Timeanddate.com documents that its date calculations account for leap years when finding the difference between two dates, in its calculation help page.

A second example spanning several calendar years

From 10 October 2022 to 3 January 2026 is 1,181 days. 2022 is not a leap year, so 10 October is day 283 of that year, leaving 365 − 283 = 82 days remaining in 2022. The three whole years in between contribute 365 (2023) + 366 (2024, a leap year) + 365 (2025) = 1,096 days. 3 January adds 3 more days. Total: 82 + 1,096 + 3 = 1,181 days, matching a direct calendar count.

Which years are leap years across a longer span

The day-of-year method depends on correctly marking every leap year a span crosses, including the century exception.

YearDivisible by 4?Leap year?
1900YesNo — century not divisible by 400
2000YesYes — divisible by 400
2024YesYes
2100YesNo — century not divisible by 400
2400YesYes — divisible by 400

How to check a day count with a weekday cross-check

172 days equals 24 full weeks and 4 extra days (172 ÷ 7 = 24 remainder 4), so the day of the week should shift by 4 places between the two dates. 14 March 2025 is a Friday; Friday plus 4 days is Tuesday, and 2 September 2025 is indeed a Tuesday. A day count whose weekday shift does not match its remainder after dividing by 7 signals an error somewhere in the day-of-year arithmetic.

Day count vs a rough month count

172 days is sometimes rounded to “about 5.6 months” by dividing by 30. That shortcut is only approximate: the same 172-day span from 14 March to 2 September crosses months of 31, 30, 31, 30, 31, and 31 days, none of which is 30. A day count and a month count answer related but different questions, and only the day count stays exact across months of different lengths.

Days in each month, for the day-of-year step

Converting a date to a day-of-year number requires the exact length of every month before it.

MonthDays
January31
February28, or 29 in a leap year
March31
April30
May31
June30
July31
August31
September30
October31
November30
December31

Why a naive 365-day-per-year shortcut undercounts a multi-year span

From 1 January 2024 to 1 January 2029 is 1,827 days by direct count. A shortcut that multiplies 5 years by 365 gives 1,825 days instead — 2 days short — because that 5-year span contains two leap years, 2024 and 2028, each contributing an extra day the flat 365-day estimate does not account for. The day-of-year method above avoids this by adding each whole year’s actual length, 365 or 366, rather than assuming every year is the same length.

The same month-day can fall on a different day-of-year number

1 March is day 60 of the year in a common year (31 January + 28 February + 1) but day 61 in a leap year (31 + 29 + 1), because the extra 29 February shifts every later date in that year forward by one position. Any date on or after 1 March needs its year’s leap status checked before its day-of-year number can be trusted; dates in January and February are unaffected, since 29 February falls after them.

A 4-year block is a fixed 1,461 days, most of the time

Three common years plus one leap year total 3 × 365 + 366 = 1,461 days, a figure some date-calculation methods use as a building block for spans measured in whole 4-year chunks. The shortcut only holds when the block contains exactly one leap year in the expected position; a block straddling a skipped century leap year, such as one that includes 1900 or 2100, totals 1,460 days instead, so the 1,461-day figure cannot be applied blindly across a full century without checking it against the century rule above.

Why spreadsheet date subtraction gives the same answer a different way

Spreadsheet programs store each date as a single serial number counted from a fixed starting date, rather than a day-of-year number reset every January. Subtracting two dates in a spreadsheet subtracts their serial numbers directly, and the result matches the day-of-year method exactly, because both approaches are really the same idea — counting continuous days — applied with a different starting point. The day-of-year method resets the count every 1 January and needs an extra step for spans crossing a year boundary; a spreadsheet’s single running count does not, which is why spreadsheet date arithmetic can be a fast way to check a manually computed day-of-year result.

Related calculators

Subtract two dates directly in the date difference calculator, review the endpoint convention in the inclusive-versus-exclusive guide, and restrict the count to weekdays with the business-days calculator.

Enter your values, review the result, then use it with confidence.

Rate this page

Be the first to rate this page.