Skip to the tool

Date difference

MDV Tools

Pick two dates and read the time between them, counted several ways.

Runs on this device Works offline
pick both dates above
How this works

Each date is turned into a count of days on the proleptic Gregorian calendar with plain integer arithmetic, so any date from 1 January of year 1 to 31 December 9999 counts the same way, leap years included, and no time zone or summer-time change can shift a day. Total days is the difference of those counts. Count the end date too adds one day, for when both ends belong to the span, as with a hotel stay counted in nights plus one or a rental counted in days.

The years, months and days are counted the way a calendar reads: whole months are added to the start while they still fit, then the days left over are counted. A month that has no matching day takes its last day, so from 31 January one month is 28 or 29 February, and from 29 February one year is 28 February. That is why, in 2023, 30 January and 31 January to 28 February both read 1 month, while their totals are 29 and 28 days. Weeks are total days divided by 7 with the remainder shown. Weekdays counts Monday to Friday from the start date up to but not including the end date (including it when the end date counts); it knows no public holidays.

With Add clock times, both moments are read as local time in this device's zone, and In hours is the real elapsed time between them. Across a change to or from summer time that is an hour more or less than the days suggest, and the page says so; a time the clocks skip is moved on by the jump, as the browser's Date does. Without times, In hours is days × 24. When To comes before From, the page counts from the earlier date and says it swapped them. Nothing is uploaded: there is no server in this file.

The Dark button remembers its setting in this browser's local storage. Nothing you type or drop into the page is stored.