Calculate the exact difference between two dates in days, weeks, months, and years
Knowing the exact number of days between two dates is useful in a surprising number of everyday situations -- from counting down to a holiday or wedding, to calculating the length of a tenancy agreement, to working out how many business days remain before a deadline. This date difference calculator gives you an instant breakdown of the time between any two dates, expressed in total days, weeks, months, years, and working days. The calculator handles all the complexities of the Gregorian calendar automatically, including leap years (every 4 years, except centuries not divisible by 400), varying month lengths (28, 29, 30, or 31 days), and year boundaries. Whether the dates are days apart or decades apart, the result is always calendar-accurate.
To calculate the difference between two dates: 1. Select the start date using the three dropdown menus for day, month, and year. This is the earlier of the two dates you want to compare. 2. Select the end date using the second set of dropdown menus. If you accidentally enter the end date before the start date, the calculator will swap them automatically and still give you a positive result. 3. View the results. The primary result is the total number of days between the two dates. Below that, you will see a breakdown in years, months, and days (remainder), total weeks, and the number of working days (Monday to Friday, excluding weekends). 4. The working day count excludes Saturdays and Sundays but does not account for public holidays, which vary by country. For precise business-day calculations, you may need to subtract any bank holidays that fall within the period. 5. The years/months/days breakdown counts complete calendar intervals. For example, 15 March to 20 June shows as 0 years, 3 months, and 5 days.
The total day count is calculated by converting both dates to milliseconds since epoch and dividing the difference by the number of milliseconds in a day (86,400,000). This gives an exact integer count regardless of month length or leap year status. The years/months/days breakdown uses calendar arithmetic. Starting from the start date, it counts how many complete years fit, then how many complete months in the remainder, then the leftover days. When the end day is smaller than the start day, it borrows from the previous month, accounting for varying month lengths. The working day calculation uses the formula: (complete weeks x 5) plus the weekday count in any partial week. Each day in the partial week is checked against its day-of-week value (0 for Sunday, 6 for Saturday) and only weekdays are counted. For example, 1 January 2024 (Monday) to 31 December 2024 (Tuesday) gives 365 total days, 52 weeks and 1 day, 0 years 11 months and 30 days, and approximately 261 working days.