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:

Duration = end time − start time
Example: 9:00 AM → 5:30 PM.
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:

MinutesDecimal hoursYou'll see this as
15 min0.25 hA quarter hour — the classic billable unit
30 min0.5 hHalf an hour
45 min0.75 hThree quarters
1 h 15 min1.25 h
2 h 30 min2.5 h
8 h 30 min8.5 hThe 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.

9:00 AM → 5:30 PM on the clock 9:00 AM 5:30 PM 8 hours 30 minutes = 8.5 h
The highlighted arc is the duration — the clock face is just a circular ruler.

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:

If end ≤ start, add 24 hours: duration = (end − start) + 24 h
Example: 11:00 PM → 7:00 AM.
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.

11:00 PM → 7:00 AM crosses midnight midnight 11:00 PM 7:00 AM = 8 hours (overnight) The calculator adds 24 hours when the end time is earlier than the start. No dates needed — the "overnight" label shows the assumption.
The bar crosses midnight — that's the whole trick. Add 24 hours and the math works.

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:

Example: start 10:30 PM, add 5 hours.
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:

Example: Monday 9:00 AM → Wednesday 5:00 PM.
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.

SpanHoursIn plain words
9:00 AM → 5:30 PM (same day)8.5A standard workday
11:00 PM → 7:00 AM (overnight)8A night shift
Mon 9:00 AM → Wed 5:00 PM56Two days and change
Fri 6:00 PM → Mon 8:00 AM62A 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:

Payroll walkthrough: you worked 9:00 AM → 5:30 PM with a 30-minute unpaid lunch.
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.

One duration, four languages (8 h 30 m) 30,600seconds 510minutes 8 h 30 mhuman 8.5 hpayroll × 60 going down · ÷ 60 going up — minutes ÷ 60 = decimal hours
Same 8½ hours in four notations. Use the human one for people, the decimal one for money.

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:

The 24-hour habit: if you do time math regularly, switch to 24-hour time. 14:30 can't be confused with anything; 2:30 can. Pilots, hospitals, and militaries use it for exactly this reason — ambiguity is the enemy.

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.

Cross-check with add mode: start 11:00 PM, add 8 hours → 7:00 AM with a +1 day indicator. The landing time confirms the subtraction was right — two modes, same answer, zero doubt.

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:

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 Calculator

100% 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: