Article — Clock Duration Calculator
Clock Duration Calculator
Clock duration is the elapsed time between two clock readings. The math is end time minus start time. When the end is earlier than the start, add 24 hours — the duration crosses midnight. A 9:00 AM to 5:30 PM shift runs 8 hours 30 minutes, or 8.50 decimal hours.
Most people compute clock duration without thinking about it. The trouble starts at midnight, with AM and PM mix-ups, and when payroll wants the answer in decimal hours instead of hours and minutes. This guide covers the formula, the standard pitfalls, the conversions, and the rounding rules US employers are allowed to apply.
What is clock duration?
Clock duration is the time between two clock readings, measured on the same 24-hour day or across a midnight boundary. It is what you get when you say "I worked from 9 to 5" or "the meeting ran 90 minutes." The two endpoints are clock times — not dates and not elapsed seconds since some epoch — and the answer is a duration, usually in hours and minutes.
It differs from elapsed time, which measures how long ago an event started relative to the current moment, and from date arithmetic, which spans multiple days. Clock duration is the building block for time-card entries, calendar-event lengths, cooking timers, athletic splits, and the parts of pay calculations that happen before the multi-day total.
How to calculate clock duration
Convert both clock times to seconds since midnight, subtract, then format. In 24-hour notation, 9:30 AM is 9×3600 + 30×60 = 34,200 seconds. 5:00 PM is 17×3600 = 61,200. The difference is 27,000 seconds — exactly 7 hours 30 minutes.
- Step 1 — convert each time to seconds since midnight using 24-hour arithmetic.
- Step 2 — subtract start from end.
- Step 3 — if the result is negative, add 86,400 (seconds in a day) for a midnight crossing.
- Step 4 — break the total seconds into hours, minutes, and seconds using integer division and modulo.
1 hour 3,600 sec1 day 86,400 secnoon (12 PM) 43,200 secmidnight (12 AM) 0 sec8h 30m 30,600 sec = 8.50 hoursClock duration across midnight
A shift from 10:00 PM to 6:00 AM looks negative on the clock: 6:00 minus 22:00 is −16 hours. Adding 24 fixes it: −16 + 24 = 8 hours. The calculator detects this automatically — any time the raw subtraction is negative, it wraps by 24.
The rule assumes the two clock readings are within a single 24-hour window. If a worker clocks in Friday at 11 PM and out Saturday at 9 PM, that is 22 hours, but a clock-only calculator will read it as −2, fix it by adding 24, and return 22 — which happens to be right. Beyond 24 hours, you need a date as well as a clock time.
If start equals end, the duration could be 0 hours or exactly 24 hours. Clock-only math cannot tell the difference. Most calculators (this one included) return 0 in that case, because zero is the safe assumption — if no time has passed, the user has not entered a duration. If you mean 24 hours, set the end one minute earlier or use a date-aware tool.
12-hour vs 24-hour clock duration
The math is the same, but the input parsing differs. In 12-hour form, you need an AM or PM marker, and the two edge cases catch most errors: 12:00 AM is midnight (00:00), and 12:00 PM is noon (12:00). The mnemonic "AM is before noon, PM is after" works for everything except the two 12-o'clocks, where the convention flips.
24-hour notation is unambiguous and is the default in most of the world. The US, UK, Canada, Australia, the Philippines, and parts of Latin America are the largest holdouts. NATO military, aviation, and medical fields use 24-hour everywhere because midnight mix-ups can be dangerous. Pharmacy systems in particular log dosing in 24-hour time.
Clock duration in decimal hours
Payroll systems usually want decimal hours, not hours and minutes. The conversion is mechanical: divide the minutes by 60 and add to the hours. 8h 30m = 8 + 30/60 = 8.50 decimal hours. 7h 15m = 7.25. 6h 45m = 6.75.
The decimal-hours number is what multiplies by the hourly rate to give gross pay. 8.50 hours at $25.00 per hour is $212.50. The exact-minute decimal stays accurate to one cent for any pay rate under $600 per hour, which covers every legal US wage. For high billing rates above $600, round to thousandths of an hour.
Payroll rounding rules
The US Department of Labor allows employers to round clock punches to the nearest 1/4 hour (15 minutes), 1/10 hour (6 minutes), or 1/12 hour (5 minutes). The rounding has to be neutral over time — it cannot consistently underpay workers. A 7:53 clock-in rounded to 7:45 is fine; the same clock-in rounded to 8:00 every time is not.
State laws can be stricter. California, New York, and several other states have moved toward exact-time recordkeeping, and a 2017 California Supreme Court decision held that an employer that rounded down 90% of the time had to pay the missing minutes. Modern timekeeping systems often capture the exact minute and apply rounding only at the report layer.
If you run a small business, capture the exact clock time and store the rounded value separately. Auditable timekeeping protects both the employer (no underpayment claims) and the worker (no surprise rounding).
Clock duration vs elapsed time
Clock duration is end minus start, both known. Elapsed time is "now minus then" — one endpoint is fixed and the other is whatever the wall clock reads at the moment you ask. The math underneath is identical, but elapsed time updates continuously and depends on the current moment, while clock duration is fixed once you know both endpoints.
Many tools confuse the two labels. A stopwatch measures elapsed time. A meeting on a calendar has a clock duration. A countdown to an event uses elapsed time computed in reverse. Whenever you build software around time, decide which kind of measurement you want before picking an API.
Shift and meeting examples
Common values you can sanity-check against this calculator: a standard US 9-to-5 office shift is 8 hours; with a 30-minute lunch, 8h 30m of clock duration and 8h paid. A nurse 12-hour shift runs 7 AM to 7 PM exactly. An overnight retail shift runs 10 PM to 7 AM, 9 hours including a 1-hour break. A 30-minute meeting from 2:00 PM ends at 2:30 PM. A 90-minute lecture from 9:00 AM ends at 10:30 AM.
For travel, an 11:45 PM departure with a 6:15 AM arrival is 6h 30m of clock duration in the same time zone. Cross multiple zones and you need a date-and-time calculator that knows the offset — otherwise you double-count or miss the wrap.