Time Duration Calculator
The time duration calculator works out how many hours and minutes pass between two times, including shifts that cross midnight.
Last updated 2026-08-14
Embed on your site
Embed this calculator on your site:
<iframe src="https://calculopedia.darzh.xyz/embed/time-duration-calculator/" width="100%" height="700" style="border:0;border-radius:12px" loading="lazy"></iframe>
quizExample
How this calculator works, with real numbers (no JavaScript needed):
Inputs
- Start time
- 09:00
- End time
- 17:00
- End time is next day
- false
Results
- Duration
- 8 hours 0 minutes
- Hours
- 8
- Minutes
- 0
- Total minutes
- 480
functionsThe formula
A time duration calculator answers "how long is it between two times?" — from shift lengths and travel times to meeting windows and cooking schedules.
How the calculation works
Each time is converted to minutes since midnight (e.g., 09:00 = 540 minutes, 17:00 = 1020 minutes). The duration is simply the difference:
Duration = end time − start time
Worked example
From 09:00 to 17:00 (a standard work shift):
- 17:00 = 1020 min, 09:00 = 540 min
- Duration = 480 minutes = 8 hours 0 minutes
From 23:00 to 07:00 next day (night shift):
- 07:00 < 23:00, so with "next day" selected the calculator adds 24 hours
- Duration = (1440 − 1380) + 420 = 480 minutes = 8 hours
Crossing midnight
If your end time is earlier than your start time, the calculator assumes the shift crosses midnight and adds 24 hours automatically. Toggle the "next day" option for clarity, or leave it off if your times genuinely don't span midnight — either way you get the same total.
Uses
- Work hours and overtime — total your daily shifts
- Travel time — how long a journey takes between departure and arrival
- Cooking and baking — precise timings
- Sporting events, exams and schedules — knowing exactly how long something runs
helpFrequently asked questions
question_markHow do I calculate the duration between two times?
Convert both times to minutes since midnight and subtract the earlier from the later. This calculator does that instantly and shows the result in hours and minutes.
question_markHow do I calculate hours between two times crossing midnight?
When the end time is earlier than the start time, the calculator adds 24 hours to the end time — so 23:00 to 07:00 is 8 hours.
question_markWhat is 9am to 5pm in hours?
9am to 5pm is exactly 8 hours and 0 minutes (480 minutes).