calculateCalculopedia
search
schedule

Time Duration Calculator

The time duration calculator works out how many hours and minutes pass between two times, including shifts that cross midnight.

verified_userReviewed by the Calculopedia editorial teamLast 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

Duration (minutes) = end − start in minutes. If end ≤ start and "next day", add 24 hours. Hours = duration ÷ 60, minutes = remainder.

A time duration calculator answers "how long is it between two times of day?" — from shift lengths and travel times to meeting windows, cooking schedules, and exam or event durations. Unlike a date calculator, it works within a single day (or across midnight) in hours and minutes, not across years.

How the calculation works

Each time is first converted to minutes since midnight: 09:00 becomes 540 minutes (9 × 60), and 17:00 becomes 1,020 minutes (17 × 60). The duration is then simply the difference between the two:

Duration = end time − start time

Worked example

From 09:00 to 17:00 (a standard work shift):

  • 17:00 = 1,020 min, 09:00 = 540 min
  • Duration = 480 minutes = 8 hours 0 minutes

From 23:00 to 07:00 next day (a night shift):

  • 07:00 = 420 min, 23:00 = 1,380 min
  • Because 420 < 1,380, the shift must cross midnight: with "next day" selected, the calculator adds 24 hours
  • Duration = (420 + 1,440) − 1,380 = 480 minutes = 8 hours

Crossing midnight

The one genuinely tricky case is when the end time is earlier than the start time. That almost always means the period crosses midnight — say, a night shift, an overnight train, or a film that ends after 12. When it happens, the calculator adds 24 hours to the end time automatically. Toggle the "next day" option to be explicit about your intent, or leave it off if the times genuinely do not span midnight; either way the total comes out the same as long as the interpretation matches your real-world situation.

Breaking the result down

  • Total minutes — the raw duration, useful for billing or precise scheduling
  • Hours — the whole hours in the duration
  • Minutes — the remaining minutes after the whole hours (e.g., 8 hours 0 minutes, or 2 hours 35 minutes)
  • Duration text — a ready-to-read phrase such as "8 hours 0 minutes"

Real-world uses

  • Work hours and overtime — total up a shift and compare against a daily target
  • Travel and transit — how long a journey runs between departure and arrival, including overnight legs
  • Cooking and baking — precise timings for recipes, resting dough or slow cookers
  • Sports, exams and events — knowing exactly how long a session, match or fixture runs
  • Media and planning — how long a recording, class or meeting block lasts

Historical note

Human timekeeping has always balanced counting with reading clocks — from sundials and water clocks to railways, which in the 1800s forced standard time zones and made precise "how long between" arithmetic a practical necessity for schedules and timetables.

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).

view_quiltYou might also need