Date Difference
Calculate the exact gap between two dates in years, months, days and total days.
Related Tools
0 comments
How it works
Years, months and days are computed by calendar borrowing — the same scheme used by HR systems for tenure and by financial systems for accrual. If the day-of-month of the end date is smaller than that of the start date, one month is borrowed and converted to the actual number of days in the previous month. If the resulting month is negative, one year is borrowed. Total days uses raw millisecond subtraction divided by 86400000, which correctly accounts for leap years and ignores daylight-saving time shifts (because UTC midnight is used).
Common use cases
- Calculating time elapsed since a project kickoff date for a status update.
- Working out how long you have lived in a place, in proper years/months/days.
- Counting days until a future deadline, including weekends.
Frequently asked questions
How is "1 month" defined?
A calendar month — variable length. A jump from Jan 15 to Feb 15 is 1 month exactly; Jan 31 to Feb 28 is also 1 month (since Feb has no 31st).
Are time zones considered?
No. Both dates are treated as UTC midnight, which gives a stable, integer day count across DST transitions.
Can the start date be after the end date?
Yes — the tool swaps them so the result is always non-negative, and notes the direction.
Are leap years handled?
Yes. Day counts and February-29 dates are correctly computed because the underlying Date object knows about leap years.