How Does the Date Difference Calculator Work?
The calculator maps both dates to an integer day count, subtracts, and returns the total. The years/months/days split uses a “borrow” method: if the end day is smaller than the start day, the algorithm borrows days from the preceding month, the same way you carry across columns in subtraction. February's 28-or-29-day width and the century rule (years divisible by 100 are not leap years unless also divisible by 400) are resolved at that step. Business days get a separate pass — the tool steps through each day and counts only Monday through Friday. In our testing, January 1 2000 to January 1 2001 returns 366 days, not 365, because 2000 is a leap year — matching the ECMAScript Date specification. Type in your dates and results appear before you lift your hands from the keyboard.