Time & Date

Time Duration Calculator

Use this free time duration calculator to find the exact elapsed time between any two clock times - in hours, minutes, and seconds. Works for same-day and overnight spans, shows total minutes, and includes a complete step-by-step explanation. Enter times in 24-hour format (HH:MM or HH:MM:SS).

All calculations use standard published formulas. Results are for informational use only.

24-hour format: HH:MM or HH:MM:SS

If earlier than start, treated as next day.

Enter start and end times to calculate the duration.

How to use this time duration calculator

  1. Enter your start time using the time picker or type directly in HH:MM or HH:MM:SS format.
  2. Enter your end time in the second field. If the end time is earlier than the start time, the calculator treats it as the following day (overnight span).
  3. Press Calculate duration.
  4. Your result appears immediately - hours, minutes, and seconds, plus total minutes, total seconds, and decimal hours.
  5. The step-by-step section below the result shows how the conversion and subtraction were done.

All times are entered in 24-hour format. 9:00 AM is 09:00, and 9:00 PM is 21:00. If you are more comfortable with 12-hour AM/PM times, convert first: add 12 to any PM hour except 12 noon itself.

How time duration calculation works

Clock times are easier to work with once you stop thinking about them as "hours and minutes" and start thinking about them as total seconds since midnight. Converting both times to a single seconds value reduces a two-component subtraction problem into a simple single-number subtraction.

The conversion formula

For any time H:MM:SS, the total seconds since midnight is: H x 3600 + M x 60 + S. This gives a single integer between 0 (midnight) and 86,399 (one second before midnight). Once both times are in this form, the duration in seconds is simply: end seconds - start seconds.

Handling overnight spans

When the end time is earlier in the day than the start time - a night shift, a flight route, or a late-evening event - the naive subtraction produces a negative number. The fix is straightforward: add 86,400 seconds (24 hours) to the end time before subtracting. This correctly models the fact that the end time falls on the following calendar day.

For example, a shift from 22:00 to 06:00: end seconds = 6 x 3600 = 21,600. Since 21,600 is less than 22 x 3600 = 79,200, add 86,400: 21,600 + 86,400 = 108,000. Duration = 108,000 - 79,200 = 28,800 seconds = exactly 8 hours.

The time duration formula

startSeconds = startH x 3600 + startM x 60 + startS endSeconds = endH x 3600 + endM x 60 + endS if endSeconds < startSeconds: endSeconds += 86400 (overnight: add 24 hours) durationSeconds = endSeconds - startSeconds hours = floor(durationSeconds / 3600) minutes = floor((durationSeconds mod 3600) / 60) seconds = durationSeconds mod 60

Converting duration to decimal hours

Decimal hours = total seconds / 3600. This format is used in payroll, billing, and any context where arithmetic on times is needed. 2 hours 30 minutes = 9,000 seconds / 3600 = 2.5 decimal hours. Multiplying by an hourly rate gives exact earnings without needing to handle minutes separately.

What is time duration and why does it matter?

Time duration is the amount of time that has elapsed between a start point and an end point. It is a fundamental concept used in almost every field: medicine (procedure length, dosing intervals), payroll (shift hours for compensation), aviation (flight times), sports (race and event timing), project management (task timelines), and everyday scheduling.

While duration seems simple, clock arithmetic has a non-obvious complication: hours and minutes are base-60 units, not base-10. You cannot add or subtract times the same way you add regular numbers. 8:45 + 0:30 is not 8:75 - it is 9:15, because 75 minutes wraps around to 1 hour and 15 minutes. Converting to total seconds eliminates this problem entirely by working in a consistent base unit.

The secondary output - decimal hours - is particularly practical. Payroll systems, legal billing, and contractor invoices nearly all use decimal hours. Knowing that a 7-hour, 45-minute shift is 7.75 hours makes multiplication by hourly rate straightforward.

Understanding your time duration result

Hours, minutes, and seconds

The classic clock format. Easiest for human communication - "the meeting ran for 1 hour and 23 minutes" is immediately understood by everyone. Use this for scheduling, planning, and any communication context.

Total minutes

The full duration expressed in minutes with no remainder. Useful for calculating data rates (megabytes per minute), cooking times, medication dosing intervals, and any formula based on a per-minute rate.

Total seconds

The most granular unit. Used in sports timing, video editing (frames), scientific experiments, and computing (log timestamps). For two times entered without seconds, this is always a multiple of 60.

Decimal hours

Hours expressed as a decimal fraction. Multiply by your hourly rate to get pay or billing. Multiply by fuel consumption per hour to get fuel used. This is the most versatile format for any rate-based calculation.

Time duration examples

Example 1 - Work shift

Start: 09:00 - End: 17:30
Start seconds: 9 x 3600 = 32,400. End seconds: 17 x 3600 + 30 x 60 = 61,200 + 1,800 = 63,000.
Duration: 63,000 - 32,400 = 30,600 seconds.
Result: 8 hours, 30 minutes (8.5 decimal hours)

Example 2 - Night shift (overnight)

Start: 22:00 - End: 06:00
End is before start - add 86,400: 6 x 3600 + 86,400 = 108,000. Start: 22 x 3600 = 79,200.
Duration: 108,000 - 79,200 = 28,800 seconds.
Result: 8 hours, 0 minutes (crosses midnight)

Example 3 - Precise timing with seconds

Start: 14:23:45 - End: 16:07:12
Start: 14 x 3600 + 23 x 60 + 45 = 51,825. End: 16 x 3600 + 7 x 60 + 12 = 57,432.
Duration: 57,432 - 51,825 = 5,607 seconds.
Result: 1 hour, 33 minutes, 27 seconds (93.45 total minutes)

Quick tips for time calculations

  • AM/PM to 24-hour: Add 12 to PM hours (except noon). 3:00 PM = 15:00. Midnight = 00:00. Noon = 12:00.
  • Payroll rounding: Many employers round to the nearest 15 minutes. 7 hours 23 minutes rounds to 7:15 (7.25 hours) or 7:30 (7.5 hours) depending on policy.
  • Decimal conversion shortcut: Minutes / 60 = decimal fraction. 15 min = 0.25, 30 min = 0.50, 45 min = 0.75.
  • Multi-day durations: This tool is designed for same-day or overnight (next-day) spans. For durations spanning more than one day, use the Date Difference Calculator and manually add the time components.

Common time calculation mistakes

Treating minutes like a base-10 decimal

8:45 + 0:30 is not 8.75 hours - it is 9:15, or exactly 9.25 hours. Working in total minutes or total seconds eliminates this confusion because you are back in a linear number system where normal arithmetic applies.

Forgetting to account for overnight spans

A shift from 10 PM to 6 AM is 8 hours, not -16 hours. If your end time is before your start time and you are not accounting for the midnight crossing, your result will be wrong. This calculator handles it automatically with a note when the span crosses midnight.

Confusing duration with clock time

A duration of 2:30 means 2 hours and 30 minutes of elapsed time. A clock time of 2:30 means 2:30 AM. They look identical but mean completely different things. Always be clear about whether a value is a clock time (a point in the day) or a duration (a span of time).

Using decimal hours as clock time

2.5 decimal hours means a duration of 2 hours and 30 minutes. It does not mean 2:50 on the clock. 0.5 hours = 30 minutes, not 50 minutes. This mix-up is common in payroll corrections and timesheet disputes.

Frequently Asked Questions

What is a time duration calculator?

A time duration calculator finds the exact elapsed time between two clock times - expressed in hours, minutes, and seconds. It is useful for calculating how long a shift lasted, how much time a task took, how long a meeting ran, or the gap between any two events in the same day. This calculator also handles overnight spans where the end time is on the next day.

How do I calculate the time between two times?

Convert both times to total seconds from midnight (hours x 3600 + minutes x 60 + seconds), then subtract. Divide the result by 3600 to get hours, divide the remainder by 60 to get minutes, and the leftover is seconds. This calculator does all of that automatically and shows the step-by-step working.

How does the calculator handle times that cross midnight?

If the end time is earlier than the start time, the calculator assumes the end time is on the next day and adds 24 hours (86,400 seconds) to the end time before subtracting. For example, a shift from 10:00 PM to 6:00 AM is treated as 8 hours. The result clearly notes when an overnight crossing has been detected.

Can I enter times with seconds?

Yes - you can enter times in HH:MM format (hours and minutes only) or HH:MM:SS format (hours, minutes, and seconds). If you omit the seconds, the calculator treats them as zero. Both 24-hour clock and regular time values are accepted.

How do I convert a time duration to decimal hours?

Divide the total minutes by 60. For example, 2 hours and 30 minutes = 150 total minutes / 60 = 2.5 decimal hours. This is the format used for payroll, billing, and timesheet entry where fractions of an hour need to be expressed as a decimal rather than minutes.

What is the difference between elapsed time and total minutes?

Elapsed time expressed as H:MM:SS is identical information to total seconds or total minutes -- they are different representations of the same duration. Total minutes (and total seconds) are useful for direct arithmetic -- for example, multiplying by an hourly rate. The H:MM:SS format is easier for people to read and communicate.