Time Between Two Times
Find the exact duration between a start and end clock time, expressed in hours, minutes, seconds, and decimal hours.
Crosses midnight
8h 30m 00s
- 1
Start seconds
09×3600 + 00×60 = 32,400 s - 2
End seconds
17×3600 + 30×60 = 63,000 s - 3
Duration in seconds
63,000 − 32,400 = 30,600 s - 4
Decimal hours
30,600 ÷ 3600 = 8.5000
How does this calculator work?
Enter a start and end clock time and this tool returns the duration between them in H:M:S, total minutes, total seconds, and decimal hours. If the end time is earlier than the start, it adds 24 hours to handle an overnight period crossing midnight automatically.
Formula
How this is calculated
Each clock time is entered as HH:MM or HH:MM:SS and converted to a number of seconds since midnight using s = hours·3600 + minutes·60 + seconds. The hours must be 0-23 and minutes/seconds 0-59 for a valid 24-hour clock.
The raw difference is diff = s_end − s_start. When the end time is earlier than the start time, the interval spans midnight, so 86,400 seconds (one full day) is added. The "Crosses midnight" control lets you force this addition even when the two times are equal, which is useful for full overnight shifts. From the resulting seconds the tool derives H:M:S with floor division and the remainder, total minutes (diff/60), and decimal hours (diff/3600).
This assumes both times fall on the same day or one consecutive overnight period, and it ignores daylight-saving transitions. For multi-day spans use a full date-and-time difference calculator instead. The range meter shows the duration as a fraction of a complete 24-hour day.
Frequently asked questions
Enter 22:00 as the start and 06:00 as the end. Because the end is earlier, the calculator automatically adds 24 hours, giving 8 hours.
Decimal hours expresses the duration as a single number, so 90 minutes becomes 1.5 hours. It is handy for payroll and billing where hours are paid in fractions.
Yes. Enter times as HH:MM:SS (for example 09:15:30) and the result will account for the seconds in every output.
Also known as
TG we-Calculate Editorial Team. (2026). Time Between Two Times [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/time-between-times
TG we-Calculate Editorial Team. "Time Between Two Times." TG we-Calculate. 2026. https://we-calculate.com/calculator/time-between-times.
TG we-Calculate Editorial Team, "Time Between Two Times," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/time-between-times
@misc{wecalculate_time_between_times, title = {Time Between Two Times}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/time-between-times}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
