Date Difference Calculator

Enter a start date and end date to find the date difference broken down into years, months, weeks, days, hours, minutes, and seconds. Toggle Include End Date to count the final day, or enable Business Days Only to skip weekends. Results update automatically so you can compare any two dates at a glance.

The earlier of the two dates

The later of the two dates

Results

Total Days

--

Years

--

Months

--

Weeks

--

Remaining Days (after weeks)

--

Total Hours

--

Total Minutes

--

Total Seconds

--

Frequently Asked Questions

What is the method used to calculate the days between two dates?

The calculator subtracts the start date from the end date using Unix timestamps (milliseconds since January 1, 1970). The difference in milliseconds is divided by 86,400,000 (the number of milliseconds in a day) and floored to get whole days. Leap years and varying month lengths are handled automatically by the JavaScript Date object.

What does 'Include End Date' mean?

By default the end date itself is not counted — only the days in between are. Enabling 'Include End Date' adds 1 extra day to the total. For example, January 1 to January 5 normally gives 4 days; with end date included it gives 5 days.

How are business days calculated?

When 'Business Days Only' is checked, the calculator loops through every day between the two dates and skips Saturdays and Sundays. The resulting count reflects only working weekdays (Monday through Friday). Public holidays are not excluded by default.

How do I calculate the days between two specific dates — for example, the 4th and 26th of July?

Enter July 4 as the start date and July 26 as the end date. The calculator will return 22 days. If you want to count both the 4th and the 26th, enable 'Include End Date' to get 23 days.

Can this calculator handle dates across different years and leap years?

Yes. The calculator correctly accounts for leap years (366 days) and non-leap years (365 days) because it relies on the native JavaScript Date object, which follows the Gregorian calendar rules precisely.

What is the difference between total days and the years/months/days breakdown?

Total days is the raw count of days between the two dates. The years, months, and weeks breakdown decomposes that span into its calendar components — useful for understanding the duration in human terms (e.g., '2 years, 3 months, and 5 days').

How far back or forward can the calculator go?

The calculator can handle any dates supported by the HTML date input and JavaScript, which spans from roughly year 100 to year 275,760. For practical purposes it works perfectly for any historical or near-future dates you are likely to need.

Why does the months figure not always divide evenly into the total days?

Calendar months vary between 28 and 31 days, so months are derived by counting full calendar months elapsed between the two dates rather than dividing total days by 30. This gives a more accurate and human-readable breakdown.

More Time & Date Tools