Figuring out how much time actually passes between two clock sounds simple until you do it by hand. Is 9:00 AM to 5:30 PM eight hours or eight and a half? If your shift runs from 10 PM to 6 AM, did you work eight hours or sixteen? This time duration calculator does the subtraction for you, handles the midnight crossing automatically, and shows the result both as a readable days/hours/minutes block and as a single decimal figure you can plug into payroll, billing, or scheduling.
Enter a start time and an end time on the 24-hour clock and the total updates instantly. When the end time comes out earlier than the start time, the tool assumes you crossed midnight and adds the missing hours — no extra math on your part.
How to Use
- Set the Start Time — Hour and Start Time — Minute. Use 24-hour time: 9 for 9 AM, 13 for 1 PM, 17 for 5 PM, 22 for 10 PM.
- Set the End Time — Hour and End Time — Minute the same way.
- Leave End Time — Days After Start at 0 for any shift, meeting, or task that starts and ends on the same calendar day.
- If your event genuinely ends on a later calendar day (an overnight flight, a multi-day workshop, a broadcast), set End Time — Days After Start to 1 or more instead of relying on the automatic overnight rule.
- Read the result card: the Days / Hours / Minutes line is the friendly breakdown, while Total (decimal hours) and Total (minutes) are the numbers you want for billing or wages.
The engine works by turning each clock time into seconds since midnight, subtracting the start from the end, and re-adding 24 hours whenever the raw difference is negative. Same start and end time means zero elapsed time, not a full day.
The Math Behind It
Every clock time becomes a number of seconds:
- startSec = startHour × 3,600 + startMinute × 60
- endSec = endHour × 3,600 + endMinute × 60
The elapsed span is simply endSec − startSec. When that difference is negative (the end clock reads earlier than the start clock on the same day), you crossed midnight, so the engine adds 86,400 seconds — a full day — to get the true duration.
Worked example: 9:00 AM is 9 × 3,600 = 32,400 seconds; 5:30 PM is 17.5 × 3,600 = 63,000 seconds. The difference is 30,600 seconds, which is 30,600 ÷ 3,600 = 8.5 hours — exactly 8 hours 30 minutes.
Overnight example: 10:00 PM is 22 × 3,600 = 79,200 seconds; 6:00 AM is 21,600 seconds. The raw difference is −57,600, so the engine adds 86,400 to reach 28,800 seconds = 8 hours. That is why a 10 PM-to-6 AM shift always lands on 8 hours, not 16.
Examples
Example 1 — A standard workday. Start 9:00 AM, end 5:30 PM. The duration is 8 hours 30 minutes, or 8.5 decimal hours. If you bill at $35 per hour, that shift is worth $297.50 before taxes — and 8.5 hours is about 106% of an 8-hour day, which matters when a timesheet caps regular hours at 8.
Example 2 — An overnight shift. A nurse clocks in at 10:00 PM (22:00) and leaves at 6:00 AM (06:00). The calculator returns 8 hours, confirming the night shift lines up exactly with a standard daytime schedule. At a night-differential rate of $32 per hour, the shift pays $256.
Example 3 — A multi-day event. A conference runs from 9:00 AM on day one to 5:30 PM two days later. Set Start 9:00, End 17:30, and End Time — Days After Start = 2. The span is 2 days, 8 hours, 30 minutes, or 56.5 total hours — enough to plan session blocks and catering around.
Example 4 — A short task. A meeting from 12:00 to 13:05 is 1 hour 5 minutes, or about 10.08% of a typical 10-hour awake day. Tracking many of these tiny spans is where the decimal-hours output earns its keep.
FAQ
How do I calculate hours between two times?
Convert both times to minutes or seconds since midnight, then subtract the start from the end. If the result is negative, you crossed midnight, so add 24 hours (86,400 seconds). This tool does that conversion automatically — just enter the two clock times.
Does this calculator handle overnight times automatically?
Yes. When the end time is earlier than the start time and the "Days After Start" field is 0, the engine assumes an overnight crossing and adds 24 hours. For example, 10:00 PM to 6:00 AM correctly returns 8 hours, not −16 hours.
What is the 24-hour clock and how do I convert AM/PM?
On a 24-hour clock, hours run from 0 (midnight) to 23 (11 PM). Morning times stay the same (9 AM = 9, 11 AM = 11). For PM times, add 12: 1 PM = 13, 5:30 PM = 17:30, 10 PM = 22. Midnight is 0, and noon is 12.
How do I convert decimal hours to hours and minutes?
Take the whole number of decimal hours as the hours, multiply the decimal part by 60 to get minutes. For example, 8.5 hours: 8 whole hours, and 0.5 × 60 = 30 minutes, so 8 h 30 min. The result card shows this breakdown for you.
Why use "Days After Start" instead of the automatic overnight rule?
The automatic rule only adds a single day. If an event ends two or three calendar days later, you must set the day offset yourself so the tool does not guess wrong. Use 0 for same-day or single-overnight spans, and 1 or more for planned multi-day events.
How do I turn duration into wages or billable cost?
Multiply the decimal hours by your hourly rate. An 8.5-hour day at $35 per hour is 8.5 × 35 = $297.50. Keep the "Total (decimal hours)" output on hand — payroll and invoicing systems use decimal hours, not "8 h 30 min".
Is a start and end time that are identical 0 hours or 24 hours?
This calculator treats identical start and end times as 0 hours. If you need a full 24-hour span (for example, a 9 AM-to-next-day-9 AM shift), set "Days After Start" to 1 instead of leaving both times equal.
Disclaimer
This time duration calculator is provided for informational purposes only and does not constitute legal, payroll, or tax advice. Elapsed-time figures are based on the clock times you enter and the standard seconds-since-midnight subtraction; actual work hours, overtime rules, break deductions, and wage calculations vary by employer, jurisdiction, and employment contract. Always confirm recorded hours, overtime eligibility, and final pay directly with your employer or a qualified payroll professional.