How to work out a time duration
- Convert both times to the 24-hour clock (2:15 PM → 14:15).
- Subtract the start from the end, seconds first, then minutes, then hours. If a column goes negative, borrow 60 from the next one.
- Add 24 hours for each day between the two dates. If the end time is earlier than the start on the next day, the period crossed midnight.
\begin{aligned} \text{duration} = \; &(\text{end date} - \text{start date}) \times 24\text{ h} \\ &+ (\text{end time} - \text{start time}) \end{aligned}In 24-hour time that is 22:45:30 to 06:20:10 plus one day.
\begin{aligned} &24\text{ h} + 6{:}20{:}10 - 22{:}45{:}30 \\ &= 30{:}20{:}10 - 22{:}45{:}30 = 7{:}34{:}40 \end{aligned}The duration is 7 hours 34 minutes 40 seconds.
Converting durations
| From | To | How | Example |
|---|---|---|---|
| Hours and minutes | Decimal hours | minutes ÷ 60 | 7 h 45 min = 7.75 h |
| Decimal hours | Hours and minutes | decimal part × 60 | 8.4 h = 8 h 24 min |
| Seconds | hh:mm:ss | ÷ 3600, then remainder ÷ 60 | 5000 s = 1:23:20 |
| Days | Hours | × 24 | 2.5 days = 60 h |
Which time calculator do I need?
| Question | Use |
|---|---|
| Time between two moments, with dates and seconds | This calculator |
| Hours worked in one shift, with a break | Hours Calculator |
| A whole week of shifts, overtime and pay | Time Card Calculator |
| Adding or subtracting durations (2 h 40 min + 1 h 35 min) | Time Calculator |
Durations in Excel or Google Sheets
| You want | Formula (start in A2, end in B2, as date-times) |
|---|---|
| Duration as h:mm:ss | =B2-A2, formatted as [h]:mm:ss |
| Decimal hours | =(B2-A2)*24 |
| Total seconds | =(B2-A2)*86400 |
The [h] brackets stop Excel from wrapping durations over 24 hours back to zero.
Frequently asked questions
How do I calculate the time between two times?
Convert both to the 24-hour clock and subtract the start from the end. If the end is earlier, add 24 hours – the period crossed midnight.
How do I convert minutes to decimal hours?
Divide the minutes by 60: 30 minutes = 0.5 hours, 45 minutes = 0.75 hours, 20 minutes = 0.333 hours.
Does it handle daylight saving time?
No. It counts clock time, so on the night clocks change, a real duration can be one hour longer or shorter than shown.
Can the duration span several days?
Yes. Choose different start and end dates and the result counts every day between, to the second.
How many seconds are in a day?
86400 seconds: 24 hours × 60 minutes × 60 seconds.