Time Duration Calculator: Hours Between Times
Hours between times, timesheet totals and decimal hours.
Time between two clock times
Add and subtract durations
Use via API
Hours worked between two clock times minus a break (crossing midnight if needed), or the total of a list of durations, as h/m, H:MM and decimal hours. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/time-duration-calculator
curl https://pithlab.com/api/v1/tools/time-duration-calculator \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"between","start":"09:15","end":"17:45","break":"30m"}'About the Time Duration Calculator
Work out the hours and minutes between two times, overnight shifts included, subtract breaks, add up a list of durations, and convert to decimal hours.
How to use the Time Duration Calculator
- Enter a start and end time, in 24-hour or am/pm form. If the end is earlier than the start, the shift is taken to run past midnight.
- Add an unpaid break such as 30m or 0:45 to subtract it. The total appears in hours and minutes and as decimal hours.
- To add up a timesheet, list one duration per line (7:30, 8h 15m, 6.5h) in the second box. Start a line with a minus sign to subtract it.
Examples
Input
09:15 to 17:45, break 30m
Output
8h 00m = 8.00 hours
Input
22:00 to 06:30, break 45m
Output
7h 45m = 7.75 hours
Input
7:30 8:15 6:45 -0:30
Output
22h 00m = 22.00 hours
Frequently asked questions
How do I convert minutes to decimal hours?
Divide the minutes by 60. 15 minutes is 0.25 hours, 30 minutes is 0.5 and 45 minutes is 0.75, so 7 hours 45 minutes is 7.75 hours. The calculator rounds decimal hours to two places.
Which duration formats can I type?
Hours and minutes with a colon (7:30 or 1:15:20 with seconds), or with units (1h 30m, 45 min, 90s, 7.5h). A bare number like 30 is rejected because it could mean minutes or hours.
What if a shift is longer than 24 hours?
Two clock times can only be up to 24 hours apart, so for longer stretches add the durations in the list instead, for example 24:00 plus 3:30.