Duration Between Times Calculator: How It Works
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
A duration between times calculator works out the exact amount of time that passes from a start time to an end time, usually shown in hours, minutes, and seconds. You enter the start time, the end time, and optionally the dates if the span crosses midnight, and the calculator returns the difference as a clock-style duration. This tool is useful for planning shifts, tracking workouts, calculating travel time, or figuring out how long an event lasts.
Formula
The basic formula for duration between two times is:
Duration = End time − Start time
Both times are converted to minutes after midnight. For example, 9:00 AM becomes 540 minutes (9 × 60), and 5:30 PM becomes 1050 minutes (17 × 60 + 30). The difference is 1050 − 540 = 510 minutes, which is 8 hours and 30 minutes.
If the end time is earlier than the start time (e.g., 11:00 PM to 2:00 AM), you add 24 hours (1440 minutes) to the end time before subtracting, because the span crosses midnight.
Worked Example
Using the default values from the calculator above:
- Start time: 09:00 → 9 × 60 = 540 minutes
- End time: 17:30 → 17 × 60 + 30 = 1050 minutes
- Difference: 1050 − 540 = 510 minutes
- Convert to hours and minutes: 510 ÷ 60 = 8.5 hours, so 8 hours and 30 minutes
The calculator shows 8:30 as the duration, which is correct.
Why Use a Duration Calculator?
Manual subtraction of times is easy to get wrong, especially when you mix AM/PM or when the span crosses noon or midnight. A calculator removes the mental math and reduces errors. It is particularly helpful for:
- Calculating work hours for a timesheet or payroll.
- Determining how long a meeting, class, or event will last.
- Planning travel itineraries, including layovers and connections.
- Tracking cooking times, baking schedules, or other time-sensitive tasks.
- Figuring out time remaining until a deadline or appointment.
How to Read the Result
The result is typically shown as hours and minutes (e.g., 8:30) or as a decimal (e.g., 8.5 hours). Both are correct, but they mean different things: 8:30 means 8 hours and 30 minutes, while 8.5 means 8 and a half hours. Many calculators offer both formats, and you should choose the one that fits your context. For payroll, decimal hours are common; for schedules, hh:mm is more intuitive.
If the duration is longer than 24 hours, the calculator may display days as well, such as “1 day, 3 hours, 20 minutes.� That happens when you include dates in the input.
Common Mistakes and How to Avoid Them
- Mixing AM and PM: Always use a 24-hour clock or clearly specify AM/PM. 9:00 could be morning or night.
- Forgetting midnight crossing: If you start at 11:00 PM and end at 1:00 AM, the duration is 2 hours, not −10 hours. The calculator adds 24 hours to the end time automatically.
- Using decimal hours incorrectly: 2.5 hours is 2 hours and 30 minutes, not 2 hours and 50 minutes. Always convert the fractional part to minutes (0.5 × 60 = 30).
- Ignoring seconds: If your times include seconds, the formula still works, but you must convert everything to seconds first (e.g., 1 hour = 3600 seconds).
Limitations of the Formula
The simple subtraction formula assumes a linear timeline with no time zone changes or daylight saving time shifts. If you are calculating duration across time zones or during a DST transition, the result may be off by an hour. For those cases, you need a more advanced tool that accounts for time zone offsets. Also, the formula treats all days as 24 hours, which is true for most purposes but not for days when DST starts or ends.
Another limitation is that the formula does not handle “business hours� or “working days.� If you need to know how many business hours are between two times, you must exclude weekends and holidays manually, which a simple duration calculator cannot do.
Alternatives to a Duration Calculator
You can calculate duration manually using the same formula, but it is slower and more error-prone. Spreadsheet software like Microsoft Excel or Google Sheets has built-in functions (e.g., =TEXT(B2-A2,"h:mm")) that do the same thing. Many smartphone clock apps also have a timer or stopwatch that measures elapsed time directly, which is useful for live events. However, for planning or historical calculations, a dedicated duration calculator is the fastest and most reliable option.
Frequently Asked Questions
How do I calculate the duration between two times including seconds?
Convert both times to seconds after midnight (hours × 3600 + minutes × 60 + seconds), subtract the start from the end, and then convert the difference back to hh:mm:ss. For example, 10:20:30 to 14:45:15 is (14×3600+45×60+15) − (10×3600+20×60+30) = 53115 − 37230 = 15885 seconds, which is 4 hours, 24 minutes, and 45 seconds.
What if the end time is earlier than the start time?
That usually means the span crosses midnight. In that case, add 24 hours to the end time before subtracting. For example, 11:00 PM to 2:00 AM: 2:00 AM is 120 minutes, but since it’s the next day, treat it as 120 + 1440 = 1560 minutes. Subtract 1380 (11 PM) from 1560 to get 180 minutes, or 3 hours.
Does the calculator handle AM/PM automatically?
It depends on the calculator. Many use a 24-hour clock to avoid ambiguity. If you see a 12-hour format, make sure you select the correct AM/PM option. The formula itself is the same; only the input format changes.
Can I calculate duration between dates and times?
Yes, but you need to include the date in the input. The calculator then converts both timestamps to a common unit (e.g., minutes since a reference date) and subtracts. The result may show days, hours, and minutes. For example, from March 1 at 9:00 AM to March 3 at 5:00 PM is 2 days and 8 hours.
Why does my result show 8.5 hours instead of 8:30?
That is a formatting difference. 8.5 hours is a decimal representation where 0.5 hours equals 30 minutes. To convert decimal hours to hh:mm, multiply the fractional part by 60. So 0.5 × 60 = 30 minutes. Both are correct; just use the format that fits your needs.
Is there a difference between duration and elapsed time?
No, they are the same concept. Duration is the amount of time between two points, and elapsed time is the time that has passed. Some contexts use “elapsed� for a live stopwatch measurement and “duration� for a planned or calculated span, but the math is identical.
Related
Formula used
in t | Start time | HH:MM | 09:00 | 0 in d | End time | HH:MM | 17:30 | 0 out dur | Duration | h:mm | (d - t) | time
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.