Time Duration Calculator
Calculate the time between two times or two dates and times, in days, hours and minutes, with totals in hours and minutes. Handles overnight spans.
Leave both dates blank to measure between two clock times; an end time earlier than the start is read as the next day.
Everything is calculated in your browser — nothing you type is uploaded anywhere.
Duration
What is a time duration calculator?
A time duration calculator measures how much time passes between a start and an end. Give it two clock times and it returns the hours and minutes between them — a work shift, a flight, a meeting. Give it two dates as well and it measures spans of any length, across midnight, month ends and leap days, in days, hours and minutes.
How to use this calculator
- For a span within a day or overnight, enter a start time and an end time and leave both dates blank. If the end time is earlier than the start time — 22:00 to 06:30 — the end is read as the next morning.
- For a span longer than a day, or one you want pinned to the calendar, fill in both dates. A blank time next to a date is taken as midnight at the start of that day, so two dates on their own give the whole days between them.
- The result updates as you type.
How to read the result
The large figure breaks the duration into days, hours and minutes, leaving out any part that is zero. Underneath are the same span as one number in different units:
- Total hours is a decimal, rounded to two places — 8 hours 30 minutes is 8.5. This is the form timesheets and hourly billing usually want.
- Hours and minutes is the same total written as H:MM, so 8.5 hours shows as 8:30 and a two-day span as 48:00. It is a length of time, not a time of day.
- Total minutes is the exact whole-number count.
- In weeks appears once the span reaches seven days.
The formula
Each moment is turned into a single count of minutes: the number of whole days since a fixed reference date, times 1,440 (the minutes in a day), plus the minutes since midnight. The duration is the end count minus the start count:
duration = (end day × 1440 + end minutes) − (start day × 1440 + start minutes)
That total is then split back up: days = ⌊total ÷ 1440⌋, hours = ⌊remainder ÷ 60⌋, and the minutes are what is left. When only times are given and the end is the smaller number, 1,440 minutes are added — that is the single step that handles crossing midnight.
Worked example
- An overnight shift from 22:00 to 06:30, no dates. 06:30 is 390 minutes after midnight and 22:00 is 1,320, so 390 − 1,320 = −930. Negative means the shift crossed midnight: −930 + 1,440 = 510 minutes, which is 8 hours, 30 minutes, or 8.5 hours.
- A multi-day span from 29 October 2026 at 09:15 to 31 October 2026 at 17:45. That is 2 whole days (2,880 minutes) plus 17:45 − 09:15 = 8 hours 30 minutes (510 minutes), so 3,390 minutes — 2 days, 8 hours, 30 minutes, or 56.5 hours.
- Across a leap day, 28 February 2024 to 1 March 2024 with no times, is 2 days, because 2024 has a 29 February. The same dates in 2025 give 1 day.
Assumptions and edge cases
- Clock time, not elapsed time across a daylight-saving change. The calculator counts every day as 24 hours. On the night clocks go forward an overnight shift really lasts an hour less, and on the night they go back an hour more; this tool does not know your time zone and does not adjust for it.
- Both times are in the same time zone. For a flight between zones, convert both ends to one zone first.
- Resolution is one minute. Seconds are ignored.
- An end before the start, when dates are given, is refused with an offer to swap them rather than shown as a negative duration. Without dates the same input is the overnight case above.
- Equal start and end times with no dates give zero, not 24 hours; enter dates for a full day.
- Only one date filled in is refused, because it is ambiguous whether the other end is the same day. Impossible dates such as 31 April and impossible times such as 25:00 are rejected rather than rolled over into the next month or day.
- The calendar is the proleptic Gregorian calendar used by JavaScript dates, which is right for any modern date and does not reflect the historical switch from the Julian calendar.