How to count the days between two dates
Pick two dates and read the total, the years-months-days breakdown, and how many of those days are working days.
Two people can count the same date range and disagree by one. Usually both of them are right, because the question of whether the last day counts has two honest answers. The days between dates calculator gives you both and lets you pick.
How it works
- Set the start and end date. They open on today and today plus 30, so there is always something on screen.
- Decide whether the end date counts as a full day. The toggle changes the total by exactly one.
- Read across: total days, weeks, hours, minutes, business days, weekend days, and the calendar breakdown in years, months, and days.
The off-by-one argument
From 1 March to 8 March is seven days if you are measuring elapsed time. It is eight days if you booked a hotel room on the first and check out on the eighth, because you were charged for eight calendar days.
Neither reading is wrong. Elapsed time is a subtraction between two instants. Occupancy is a count of the boxes on a calendar you coloured in. Payroll, rental agreements, vacation policies, and prison sentences almost always mean the second one. Project deadlines and age almost always mean the first. When the toggle is on, the tool extends the span by one day and recomputes everything from that, so the breakdown and the business day figure stay consistent with the headline number instead of drifting apart.
Why timestamp subtraction gets it wrong
The obvious way to write this is (end - start) / 86400000. It works until the range crosses a daylight saving boundary. In most of Europe and North America, one day each spring is 23 hours long and one day each autumn is 25. Divide by 86,400,000 across the March change and you get 30.958 days, which floors to 30 when the calendar clearly shows 31.
The fix is to stop measuring time and start counting dates. The tool moves both inputs to UTC midnight before it subtracts anything. UTC has no clock changes, so every day in it is exactly 86,400 seconds and the division is always a whole number. The hours and minutes figures still assume 24-hour days, which is the right assumption for planning and the wrong one if you need the true elapsed seconds across a clock change.
Business days, and what the number leaves out
The business days figure removes Saturdays and Sundays. It does that with arithmetic rather than a loop: full weeks contribute five working days each, and only the leftover days at the end need checking individually. That keeps a span of four centuries as fast as a span of four days.
What it cannot know is your holidays. Christmas, Eid, Diwali, Golden Week, and the Monday your company closes for a local festival all differ by country, region, and employer. Any tool claiming to handle them without asking where you are is guessing. Subtract yours from the figure the tool gives you. For a version where you enter the holiday dates yourself, use the business days calculator.
Years, months, and days
The breakdown walks the calendar rather than dividing by an average month length. From 31 January to 1 March reads as one month and one day, not 29 days converted into 0.95 months. Leap years take care of themselves because February simply has the length it has. This is the same arithmetic behind the age calculator, which is why the two tools always agree.