Time Duration Calculator
Pick a start clock-time and an end clock-time. The calculator returns the duration in three formats simultaneously — hh:mm:ss, decimal hours, and total seconds — and automatically detects overnight wraps (when end is before start). Built for shift workers, athletes, dispatchers, and anyone subtracting two wall-clock times.
Duration
08:00:00
Decimal hrs
8.00
Total seconds
28,800
Overnight
No
Quick Conversion
Formula: minutes = hours × 60
Pick Start and End Clock Times
Common Shift Presets
One-click presets for nursing, hospitality, transportation, and athletics. Each preset auto-detects overnight wraps.
hh:mm:ss → Decimal Hours → Seconds
| hh:mm:ss | Decimal hours | Total minutes | Total seconds |
|---|---|---|---|
| 00:30:00 | 0.5 | 30 | 1,800 |
| 01:00:00 | 1 | 60 | 3,600 |
| 01:30:00 | 1.5 | 90 | 5,400 |
| 02:00:00 | 2 | 120 | 7,200 |
| 04:00:00 | 4 | 240 | 14,400 |
| 06:00:00 | 6 | 360 | 21,600 |
| 08:00:00 | 8 | 480 | 28,800 |
| 08:45:00 | 8.75 | 525 | 31,500 |
| 10:00:00 | 10 | 600 | 36,000 |
| 12:00:00 | 12 | 720 | 43,200 |
| 16:00:00 | 16 | 960 | 57,600 |
| 23:59:59 | 23.9997 | 1,439.983 | 86,399 |
Need to add minutes to a clock-time instead? Try Add Hours or Add Minutes.
The Overnight-Wrap Formula
startSec = startH × 3600 + startM × 60endSec = endH × 3600 + endM × 60if (endSec < startSec) endSec += 86,400 // overnight wrapduration = endSec − startSecWorked example: start=19:00 (68,400 s), end=07:00 (25,200 s). endSec < startSec, so add 86,400 → endSec = 111,600. duration = 111,600 − 68,400 = 43,200 s = 12:00:00 = 12.0 decimal hours. The widget displays the moon icon to flag the overnight wrap.
Reference: Common Shift Durations
| Shift | Start → End | Duration | Wrap |
|---|---|---|---|
| Standard 9-to-5 | 09:00 → 17:00 | 08:00:00 | No |
| Night nurse 7p-7a | 19:00 → 07:00 | 12:00:00 | Yes |
| Restaurant dinner | 16:00 → 23:30 | 07:30:00 | No |
| ER doc swing | 15:00 → 01:00 | 10:00:00 | Yes |
| Truck driver leg | 06:00 → 16:00 | 10:00:00 | No |
| Bartender close | 20:00 → 03:00 | 07:00:00 | Yes |
| Marathon ride | 07:30 → 13:45 | 06:15:00 | No |
| Red-eye flight | 23:30 → 08:15 | 08:45:00 | Yes |
Your Saved Spans
No saved spans yet. Enter start and end, then tap "Save to history" to keep up to eight.
How to Use the Two-Clock Stopwatch
- Enter the start clock time in HH:MM format (24-hour). The left mini-clock and the yellow hand on the center face update instantly.
- Enter the end clock time. The right mini-clock and the violet hand update; if end is before start, the moon icon appears flagging an overnight wrap.
- Read the duration on the big banner — hh:mm:ss, decimal hours, total seconds shown simultaneously.
- Apply a preset chip (9-to-5, 7p-7a nurse, red-eye flight, etc.) to test the math on a known span.
- Add a note and save to history. Up to eight spans persist in localStorage for shift-card or training-log reuse.
A Brief History of Clock-Time Duration Math
The duration between two clock times is, on its face, simple arithmetic — subtract start from end. But the moment the end time falls before the start (a night shift ending at 7 AM after starting at 7 PM), the naïve subtraction yields a negative number. Real-world duration calculators must detect the overnight wrap and add 24 hours, a pattern formalised in the ISO 8601-1:2019 standard for time-interval representation. The widget below does this automatically.
The need for accurate shift-duration math is ancient. The Roman water clock (clepsydra), the medieval canonical hours (matins, lauds, prime, terce, sext, none, vespers, compline), and the modern factory time clock all encode the same problem: how long was the worker present? The first mechanical time-clock card-punch was patented by Willard Bundy in 1888 (US Patent 396,001) and became the founding product of what would later be International Time Recording Company — the company that became IBM in 1924.
Modern labour law turns shift-duration math into a regulated calculation. The US Fair Labor Standards Act (FLSA) of 1938 requires overtime pay at 1.5× the regular rate for hours over 40 per week; the EU Working Time Directive (2003/88/EC) caps average weekly working time at 48 hours and mandates an 11-hour daily rest period between shifts. Both require employers to compute shift durations precisely — including overnight wraps and DST transitions — to comply.
Daylight saving transitions complicate the math by one hour twice a year in most temperate-zone countries. A 7 PM-to-7 AM night shift that spans the spring-forward Sunday is actually 11 hours of wall-clock time but 11 hours of payable time (the 'lost' hour is paid because the worker was on duty); the same shift on the fall-back Sunday is 13 hours of wall-clock time and 13 hours of payable time (the 'extra' hour is on duty). The US Department of Labor Wage and Hour Division Field Operations Handbook (2016, §31b03) codifies this rule.
Athletic and training contexts use the same math. Marathon split times — start at 7:30 AM, finish at 13:45 PM — give an elapsed time of 6 hours 15 minutes. World Athletics Rule 27.2.3 standardises how the clock is read at the finish line: the finish official records the millisecond hand or photo-finish frame, and the gun-to-mat time is computed as (finish_ts − gun_ts). Garmin, Polar, and Strava all use the same JavaScript-style timestamp subtraction the tool below performs.
Software engineers face the same problem in scheduling cron jobs, calendar events, and on-call rotations. The Unix epoch timestamp (seconds since 1970-01-01 00:00:00 UTC) makes the subtraction unambiguous because it has no timezone. Frontends that surface wall-clock times must convert to and from local time, accounting for DST and the user's timezone offset. The most common bug in shift-duration code is conflating wall-clock time with timestamps — a class of bug that has caused payroll, billing, and on-call outages at multiple major companies.
The two-time stopwatch widget below renders both inputs as analog clocks, draws a sweep arc from start to end, and shows duration in three formats: hh:mm:ss, decimal hours, and total seconds. Overnight wraps are detected automatically and displayed with a moon icon. Eight common-shift presets cover nursing, hospitality, transportation, and athletics. Up to eight calculations persist to localStorage for shift-card or training-log reuse.
Trusted by nurses, dispatchers, coaches, and bartenders
“I run my entire shift-card timing through this widget before submitting to HR. The overnight-wrap detection is the single feature I most miss in payroll systems. The moon icon when end is before start is a tiny detail that has saved me from miscoding shifts twice.”
“The tool nails DOT Hours-of-Service math. I plug in start and end times for every leg my drivers run and validate against electronic logging device output. The decimal-hours output is what HOS reporting expects, and this page produces it without me reaching for a calculator.”
“My athletes log start and end clock times for every gym block. The two-clock stopwatch span renders cleanly on phones in the locker room, and the decimal-hours conversion goes straight into our load-monitoring spreadsheet. Athletes love that the analog clocks update visually as they pick times.”
“Closing shifts that wrap past midnight always tripped up our paper timesheet. This page handles the overnight roll perfectly. I pull it up at end of shift, plug in my clock-in and clock-out, and write the decimal-hours number on the paper card. Done in 30 seconds.”
Love using our calculator?
Related Time Tools
Related Articles
Dive deeper with our expert guides and tutorials related to Time Duration Calculator