Date Difference Calculator

Find the years, months, weeks and days between any two dates.

Enter the values to see the result here.

Formula

Each date is converted to a day number (days since 1 January 1970). The total is a plain subtraction:

days=Nend−Nstart  (+1 if inclusive)\text{days} = N_{\text{end}} - N_{\text{start}} \;(+1 \text{ if inclusive})

Weeks are ⌊days/7⌋\lfloor \text{days} / 7 \rfloor with days mod 7\text{days} \bmod 7 left over, and hours are 24×days24 \times \text{days}. The years/months/days split borrows the length of the previous calendar month when the day part is negative.

Worked example

From 15 January 2024 to 20 April 2025.

  • Day numbers differ by 461, because 2024 is a leap year (366 days from 15 Jan 2024 to 15 Jan 2025, plus 95 days to 20 April 2025).
  • Weeks: 461=65×7+6461 = 65 \times 7 + 6, so 65 weeks and 6 days.
  • Calendar split: 1 year, 3 months, 5 days.
  • Hours: 461×24=11,064461 \times 24 = 11{,}064.

Common mistakes

  • Counting only the months and ignoring that February 2024 has 29 days.
  • Using a 30-day month to convert days to months, which is off by up to a day per month.
  • Forgetting the inclusive count when a legal period says “including both dates”.
  • Mixing Hijri and Gregorian dates: this tool takes Gregorian dates only, so convert Hijri dates first.

Frequently asked questions

Does the result include the start and end day?

By default no. From 1 June to 2 June is 1 day. Tick "Count the end day too" when both days count, such as hotel nights plus the checkout day or contract periods written as "from X to Y inclusive".

Why does the years-months-days split differ from total days divided by 30?

Months have 28 to 31 days, so the split follows the calendar. Total days is exact; the y/m/d breakdown is a calendar reading of the same gap.

Can I enter the later date first?

Yes. The tool swaps them and tells you it did, so the answer is never negative.

Related calculators