Time Duration Calculator
Working out how long something lasted between two clock times is a constant need for timesheets, shift logs, billing, and planning, yet the minutes arithmetic and overnight wrap-around are easy to get wrong by hand. This calculator takes a start and end time and returns the elapsed duration as hours and minutes, as total minutes, and as decimal hours, the form most payroll and invoicing systems expect. If the end time is earlier than the start it assumes the period crossed midnight and adds a day, so an overnight shift comes out correct rather than negative.
Time duration formula
start minutes = start hour * 60 + start minute
end minutes = end hour * 60 + end minute
duration = end minutes - start minutes (add 1440 if negative)
decimal hours = duration / 60
Both times are converted to minutes past midnight before subtracting. If the difference is negative the period is assumed to cross midnight, so 1,440 minutes (one day) is added. Decimal hours divide the total minutes by 60.
Time duration notes
- Decimal hours are the standard form for payroll and billing.
- 30 minutes is 0.50 decimal hours; 15 minutes is 0.25.
- An end time before the start time is treated as overnight.
- The calculation works to the minute, not the second.
- Total minutes is useful when an exact whole-minute count is needed.
Time duration: frequently asked questions
How do I calculate the duration between two times?
Convert both times to minutes past midnight, subtract the start from the end, and convert the result back to hours and minutes. For example, 9:15 to 17:45 is 1,065 minutes minus 555 minutes, which is 510 minutes, or 8 hours 30 minutes.
What about a duration that crosses midnight?
If the end time is earlier than the start time, the calculator assumes the period runs past midnight into the next day and adds 24 hours. So 22:30 to 06:15 is treated as 7 hours 45 minutes rather than a negative duration.
What are decimal hours?
Decimal hours express minutes as a fraction of an hour, which is useful for timesheets and billing. 8 hours 30 minutes is 8.50 decimal hours because 30 minutes is half an hour. The calculator shows both the hours-and-minutes form and the decimal form.
Can I use this for billing or timesheets?
Yes. The decimal-hours output is the figure most payroll and invoicing systems expect, since multiplying decimal hours by an hourly rate gives the amount directly. The total-minutes output is handy when you need an exact whole-minute count.
Does it include seconds?
This calculator works to the minute, which suits most scheduling, payroll, and planning needs. If you need second-level precision, a stopwatch or a dedicated time-difference tool that accepts seconds would be more appropriate.
Official sources
- International Organization for Standardization: ISO 8601 date and time format.
- NIST Time and Frequency Division: Time and Frequency.
Reviewed by the CalculatorHub team, edited by James Graham, 17 June 2026. See our methodology.