Dates and time
Time duration calculator
Enter a start and end time on a 24-hour clock. If the end is earlier than the start, the shift is treated as ending the next day. If the start and end are the same time, it counts as a full 24 hours.
What this means
- The time worked is 8 hours, or 8.00 hours in decimal form.
- Timesheets and payroll often use decimal hours: 30 minutes is 0.5 and 15 minutes is 0.25.
What if
About this calculator
What this calculator does
It converts both times to minutes after midnight, subtracts, adds a day if the end is earlier than the start, then removes the break.
How it is calculated
minutes = (end hour * 60 + end minute) - (start hour * 60 + start minute)
if end is not after start, add 1,440 minutes (one day)
decimal hours = minutes / 60
How to read the result
Duration is in hours and minutes. Decimal hours is the same time as a single number, which is what most pay calculations use.
Sources and method
Standard arithmetic with no outside data. The formula is shown under How it is calculated, and unit tests check worked examples, including edge cases. Equal start and end times count as 24 hours.
This page uses arithmetic only, with no outside data.
Questions
How do I enter 5:30 PM?
Hour 17, minute 30. Add 12 to afternoon hours, except 12 PM stays 12.
What about overnight shifts?
If the end time is earlier than the start time, the page assumes the shift ends the next day.
What is 7 hours 45 minutes in decimal?
7.75 hours, because 45 minutes is 0.75 of an hour.
Does it handle daylight saving changes?
No. On the night clocks change, adjust by one hour yourself.