1What a time-duration calculation is
A time-duration calculation answers one question: how much time passed between moment A and moment B? That's it. The 9:00 AM to 5:30 PM workday. The 11:00 PM to 7:00 AM night shift. The flight that left at 6:15 and landed at 9:40. Simple question — but clocks are weird instruments, and the edge cases bite.
What makes time math trickier than regular subtraction? Three things. First, hours aren't decimal — an hour has 60 minutes, so 1:30 isn't "one point thirty," it's one-and-a-half. Second, the clock wraps around — after 11:59 PM comes 12:00 AM, and naive subtraction breaks at midnight. Third, humans write times ambiguously — is 12:00 noon or midnight? Is 8:00 AM or PM? Every one of these has caused real payroll errors and missed flights.
Our calculator handles all of it: plain subtraction, overnight spans, adding or subtracting durations from a time, multi-day spans with dates, and decimal-hour output for payroll. Let's walk through each mode the way you'd actually use it.
2Subtracting times: the basic method
The core operation is subtraction: end minus start. Convert both times to minutes (or hours) since midnight, subtract, convert back:
9:00 AM = 9 × 60 = 540 minutes. 5:30 PM = 17 × 60 + 30 = 1,050 minutes.
1,050 − 540 = 510 minutes = 8 hours 30 minutes = 8.5 decimal hours.
That last conversion — to decimal hours — deserves attention, because payroll systems run on it. Divide the minutes by 60 and add to the hours: 30 ÷ 60 = 0.5, so 8:30 becomes 8.5. The common ones are worth memorizing:
| Minutes | Decimal hours | You'll see this as |
|---|---|---|
| 15 min | 0.25 h | A quarter hour — the classic billable unit |
| 30 min | 0.5 h | Half an hour |
| 45 min | 0.75 h | Three quarters |
| 1 h 15 min | 1.25 h | |
| 2 h 30 min | 2.5 h | |
| 8 h 30 min | 8.5 h | The standard full workday |
Why does payroll insist on decimals? Because multiplying is cleaner: 8.5 hours × $20/hour = $170. Try that with "8:30" and you'll see why accountants revolted. If you ever log hours for pay, decimal is the language — and our calculator speaks it fluently.
3Overnight spans: when the end looks "earlier"
Here's the classic trap: a night shift from 11:00 PM to 7:00 AM. Naive subtraction says 7 − 23 = −16 hours. Obviously wrong — the shift was 8 hours. The fix is the overnight rule:
7:00 AM = 7 × 60 = 420 minutes. 11:00 PM = 23 × 60 = 1,380 minutes.
420 − 1,380 = −960 → add 24 h (1,440 min): −960 + 1,440 = 480 minutes = 8 hours.
Our calculator applies this automatically and labels the result "overnight" so the assumption is transparent. That label matters: it's the calculator telling you "I assumed the end time is tomorrow." For a night shift, that assumption is exactly right. For a typo'd end time, the label is your hint to double-check.
When does the overnight assumption not apply? When you've entered actual dates. If you set start = Monday and end = Wednesday, the calculator does exact date math instead — no assumptions needed. The overnight rule is the fallback for time-only input, and it's right the vast majority of the time.
4Add/subtract mode: time travel on purpose
Sometimes you don't want a duration — you want a landing time. "It's 10:30 PM and the drive takes 5 hours — when do I arrive?" That's addition, and the calculator's Add / subtract mode handles it, wrapping past midnight correctly:
10:30 PM + 5 h = 3:30 AM — and the calculator shows a +1 day indicator, so you know you've crossed into tomorrow.
Reverse: start 1:00 AM, subtract 3 hours = 10:00 PM with a −1 day indicator (yesterday).
The day indicator is the unsung hero here. Without it, "3:30 AM" is ambiguous — today or tomorrow? The +1/−1 tag removes the ambiguity, which is exactly what you need when the answer feeds into travel plans, medication schedules, or shift handoffs.
Practical uses: arrival-time math ("flight lands 7h 45m after a 10:20 PM takeoff"), deadline math ("the report is due 48 hours from now — what time is that?"), and cooking across midnight ("the roast needs 6 hours and it's 8 PM"). Anytime you'd do clock arithmetic on your fingers, this mode does it without the finger-counting errors.
5Multi-day spans with date fields
For spans longer than a day, times alone aren't enough — you need the optional start and end date fields. With both dates set, the calculator does exact date math and the overnight assumption switches off:
Monday 9 AM → Wednesday 9 AM = 48 hours, plus 9 AM → 5 PM = 8 hours.
Total: 56 hours = 2 days, 8 hours = 201,600 seconds.
This mode is the bridge between time math and date math — useful for on-call rotations ("I'm on call from Friday 6 PM to Monday 8 AM" = 62 hours), rental periods, parking calculations, and any "how long was that, really?" question spanning days. For pure date-to-date counting without times, the date difference calculator is the cleaner tool.
| Span | Hours | In plain words |
|---|---|---|
| 9:00 AM → 5:30 PM (same day) | 8.5 | A standard workday |
| 11:00 PM → 7:00 AM (overnight) | 8 | A night shift |
| Mon 9:00 AM → Wed 5:00 PM | 56 | Two days and change |
| Fri 6:00 PM → Mon 8:00 AM | 62 | A full weekend on call |
| 10:30 PM + 5 hours | — | Lands 3:30 AM (+1 day) |
6Decimal hours, minutes, seconds — and payroll
The calculator shows every result in multiple units, and each one has a job:
- Hours and minutes (8 h 30 m) — the human format. Use it for schedules, plans, and telling people things.
- Decimal hours (8.5 h) — the payroll format. Multiply by your hourly rate and you're done: 8.5 × $20 = $170. No minute-math required.
- Total minutes (510) — handy for short durations and billing in minute increments.
- Total seconds (30,600) — the engineering format. 8 hours 30 minutes × 3,600 = 30,600 seconds. Useful for timers, sports timing, and anything measured precisely.
Gross: 8.5 h. Minus lunch: 8.5 − 0.5 = 8.0 h.
At $22/hour: 8.0 × 22 = $176.00 for the day.
Five such days: 40.0 h × $22 = $880.00 gross.
The classic payroll mistake is entering "8.30" meaning 8 hours 30 minutes into a system that reads it as 8.3 decimal hours — that's 8 hours 18 minutes, and you've just shorted yourself 12 minutes. Decimal hours and clock notation are different languages. 8:30 (clock) = 8.5 (decimal). Convert first, then enter. Our work hours calculator is built for exactly this weekly-payroll workflow.
7Mistakes: AM/PM, noon, and midnight
Time math has three classic traps, and they're all about writing the time down wrong before the math even starts:
- AM/PM mix-ups. Entering 8:00 when you meant 8:00 PM turns a 12-hour error into your result. The calculator can't read your mind — double-check the AM/PM (or use 24-hour format: 20:00 is unambiguous).
- The 12:00 problem. 12:00 AM is midnight (start of the day); 12:00 PM is noon. It's backwards from what intuition suggests — "12 AM" feels like it should be midday-adjacent, but it's the middle of the night. When in doubt, write "midnight" or "noon" in words.
- Decimal/clock confusion. 8.5 hours ≠ 8:50. Eight-point-five is 8:30; eight-fifty doesn't exist on a clock. Convert before entering numbers into payroll systems.
- Forgetting the lunch break. "9 to 5:30" is 8.5 hours gross, but with 30 minutes unpaid lunch it's 8.0 payable. Payroll disputes are born here — always clarify paid vs. gross.
8Walkthrough: the night-shift paycheck
Let's run a full real-world case: a night-shift worker, 11:00 PM → 7:00 AM, five nights a week, $24/hour with a 30-minute unpaid break.
Step 1 — the shift length. Enter 11:00 PM → 7:00 AM. The end is earlier than the start, so the overnight rule adds 24 hours: 8 hours, labeled overnight. Sanity check passes — that's a standard shift.
Step 2 — payable hours. 8.0 − 0.5 (break) = 7.5 decimal hours per night.
Step 3 — the week. 7.5 × 5 = 37.5 hours. In seconds, for the curious: 37.5 × 3,600 = 135,000.
Step 4 — the pay. 37.5 × $24 = $900.00 gross for the week.
That's the whole workflow: subtract for the duration, convert to decimal for money, multiply by the rate. Every timesheet you've ever filled in is this calculation wearing different clothes.
9Which mode do you need? A 10-second chooser
The calculator has three modes, and picking the right one is half the battle:
- "How long between A and B?" → Duration mode. Two times in, one duration out. This is the default and covers shifts, workdays, flights, and cooking.
- "What time will it be X hours from now?" → Add/subtract mode. A start time plus a duration gives you a landing time, with +1/−1 day indicators when midnight is crossed. Arrival times, deadlines, reminders.
- "How long including the dates?" → Duration mode with date fields. When the span crosses days, add the dates and get exact multi-day math — no overnight assumptions, just the real count.
If you're ever unsure, start with duration mode: it's the most forgiving, and the overnight label will tell you when it made an assumption. You can always switch modes without retyping — the times carry over.
Measure it exactly — try the free calculator
Enter a start and end time for the exact duration — with overnight handling, add/subtract mode, multi-day spans, and decimal hours.
⏱️ Open the Time Duration Calculator100% free · No account · Private by design
10Frequently asked questions
How do you calculate hours between two times overnight?
Subtract the start time from the end time; if the end time is earlier than or equal to the start (for example, 11:00 PM to 7:00 AM), add 24 hours. This calculator does it automatically and shows an 'overnight' note. For exact multi-day spans, use the optional date fields.
How do I convert hours and minutes to decimal hours?
1 hour 30 minutes equals 1.5 decimal hours — divide the minutes by 60 and add: 1 + 30/60 = 1.5. Common values: 15 min = 0.25 h, 30 min = 0.5 h, 45 min = 0.75 h.
Can I add hours to a time?
Use the Add / subtract mode below: enter a start time, the hours and minutes to add, and choose add or subtract. The result wraps past midnight correctly and shows a +1 day or −1 day indicator when the day changes.
What if the end time is earlier than the start time?
When the end time is earlier than the start time and no dates are entered, the calculator assumes the end time falls on the next day — the classic overnight shift (e.g., 11:00 PM to 7:00 AM = 8 hours) — and labels it overnight so the assumption is transparent.
Can it handle spans longer than a day?
Yes. The optional start and end date fields handle multi-day spans exactly — for example, Monday 9:00 AM to Wednesday 5:00 PM gives 56 hours. When both dates are set, the overnight assumption is replaced by exact date math.
How do I get the total in seconds?
Multiply hours by 3,600. The calculator shows the total seconds for every result automatically — for example, 8 hours 30 minutes = 30,600 seconds.
Keep exploring
Time math pairs well with these:
Related guides
More step-by-step guides on this topic:
