Clock Duration Calculator
This calculator works out the exact elapsed time between two clock times, useful for timesheets, payroll, shift planning, travel times and working out how long has passed between a start point and an end point in the day. Enter your start time and end time using either 12-hour format with AM/PM or 24-hour format, whichever matches how your times are recorded. You can also set whether the times fall on the same day or the end time is next day; left on auto-detect, it assumes an overnight span whenever the end time is earlier than the start time, so a shift from 10pm to 6am reads correctly as 8 hours rather than a negative number. The results show the duration in hours and minutes, the total elapsed minutes, and the equivalent decimal hours, the format most payroll systems use when multiplying hours worked by an hourly rate. A calculation breakdown converts both times to minutes since midnight and shows any overnight adjustment applied, while a further table expresses the duration in total seconds and as a fraction of a day and a week. Use the 24-hour option if AM/PM is confusing, and double-check the overnight setting whenever a shift crosses midnight. The calculator works with clock times only and does not adjust for daylight saving, so times either side of a clock change need adjusting manually by an hour.
1. Start Time
2. End Time
Calculation Breakdown
Duration in Different Units
How to Calculate Duration Between Two Times
The duration between two clock times is found by converting both times to the total number of minutes since midnight, then subtracting the start from the end. If the result is negative (meaning the end time is earlier in the day than the start time), add 1,440 minutes (the number of minutes in 24 hours) to get the correct overnight duration.
The Formula
Convert each time to minutes since midnight:
- Minutes since midnight = (hour x 60) + minutes
- For AM/PM, convert to 24-hour first: 12 AM = 0, 1 AM = 1, ..., 12 PM = 12, 1 PM = 13, ..., 11 PM = 23
Then: Elapsed minutes = End minutes - Start minutes
If Elapsed minutes is negative or you have selected "next day": Elapsed minutes = Elapsed minutes + 1,440
To convert elapsed minutes to hours and minutes: Hours = floor(Elapsed / 60), Minutes = Elapsed mod 60
To convert to decimal hours: Decimal hours = Elapsed minutes / 60
AM/PM to 24-Hour Conversion
| 12-hour | 24-hour | Minutes since midnight |
|---|---|---|
| 12:00 AM (midnight) | 00:00 | 0 |
| 6:00 AM | 06:00 | 360 |
| 9:00 AM | 09:00 | 540 |
| 12:00 PM (noon) | 12:00 | 720 |
| 5:30 PM | 17:30 | 1,050 |
| 11:59 PM | 23:59 | 1,439 |
Worked Example
Default inputs: start 9:00 AM, end 5:30 PM.
- 9:00 AM = 9 x 60 + 0 = 540 minutes since midnight
- 5:30 PM = 17 x 60 + 30 = 1,050 minutes since midnight
- Elapsed = 1,050 - 540 = 510 minutes
- Duration = 510 / 60 = 8 hours 30 minutes (8.50 decimal hours)
This matches the calculator output of 8h 30m (510 total minutes, 8.50 decimal hours).
Overnight Duration Example
Start 10:00 PM, end 6:30 AM (next morning):
- 10:00 PM = 22 x 60 = 1,320 minutes since midnight
- 6:30 AM = 6 x 60 + 30 = 390 minutes since midnight
- Elapsed = 390 - 1,320 = -930 minutes (negative, so add 1,440)
- Elapsed = -930 + 1,440 = 510 minutes = 8 hours 30 minutes
Common Uses
- Timesheets and payroll: calculate hours worked between clock-on and clock-off times, expressed as decimal hours for easy multiplication by an hourly rate.
- Shift planning: determine the length of a shift, including night shifts that span midnight.
- Travel: work out how long a journey takes between departure and arrival times.
- Scheduling: find out how much time is available between two appointments or events.
- Cooking and baking: calculate how long something has been in the oven or how long until the timer goes off.
Related Calculators
- Maths and Stats Calculators: full hub of maths tools.
- Time Duration Calculator: duration across multiple time segments.
- Time Calculator: add or subtract hours, minutes, and seconds.
- Add Business Days Calculator: add working days to a date.
- Time Duration Between Times Calculator: detailed interval calculator.
Method: Standard time arithmetic. Duration in minutes = (end hour x 60 + end minutes) - (start hour x 60 + start minutes). If the result is negative, 1,440 minutes (24 hours) is added to reflect a span across midnight. Decimal hours = total minutes / 60.
This calculator works with clock times only and does not account for daylight saving transitions. For scheduling purposes that cross a daylight saving boundary, adjust times manually by one hour as appropriate.