Time Duration Calculator

Find the duration between two times of day, or add and subtract hours and minutes from a start time — handling midnight crossovers correctly.

How to use this calculator

  1. 1Choose whether you are finding a difference or adding/subtracting a duration.
  2. 2Enter times as HH:MM with AM/PM, or in 24-hour format.
  3. 3For an overnight span, switch on "the end time is the next day".

How the calculation works

Duration = End − Start (+ 1440 minutes if it crosses midnight)
1440
Minutes in a day — added when the end time is earlier on the clock than the start

Clock times alone cannot say whether the end is the same day or the next — an overnight shift from 22:00 to 06:00 needs that stated explicitly, which is what the midnight-crossing option does.

Decimal hours are what most timesheet and payroll systems expect, rather than hours and minutes.

Worked example

From 9:15 AM to 5:45 PM

  1. 1.9:15 AM is 555 minutes into the day; 5:45 PM is 1,065 minutes.
  2. 2.1,065 − 555 = 510 minutes.
  3. 3.510 minutes is 8 hours and 30 minutes, or 8.5 decimal hours.

Result: 8h 30m (8.5 decimal hours)

Clock time versus calendar time

A duration between two clock times lives on a different kind of number line than a duration between two dates. A date difference tracks a position on the calendar — years, months, days — where the units are all different lengths and leap years occasionally add an extra day. A clock-time duration tracks a position on a 24-hour wheel that resets to zero every midnight, so the only real complication is what happens when a span crosses that reset point, which is exactly what an overnight shift or a late-night flight does.

That is why this calculator treats "the end time is the next day" as something you state explicitly rather than something it can guess. Without a date attached to either time, 11 PM to 6 AM could mean seven hours overnight, or negative eighteen hours if both were somehow meant to be the same day — the calculator resolves the ambiguity in favor of the interpretation that actually makes sense for a shift, but the toggle exists for the cases where that guess would be wrong.

Why decimal hours matter

Eight hours and thirty minutes is a natural way to describe a shift out loud, but almost no payroll or billing system stores time that way. Decimal hours — 8.5 instead of 8:30 — are what most timesheet software, spreadsheets and invoicing tools actually expect, because they can be multiplied directly by an hourly rate without a separate step to convert sixty minutes into a fraction of an hour. Converting by hand is a well-known source of small billing errors: treating 8 hours 30 minutes as "8.30" rather than 8.5 quietly overstates or understates every invoice it touches.

Some industries go further and bill in fixed sub-hour increments rather than continuous decimal hours — legal billing commonly rounds to the nearest tenth of an hour, a six-minute block, specifically so that time entries stay easy to total and audit.

Where this kind of time math shows up

Measuring or projecting a clock time, rather than a calendar date, is a small calculation that recurs constantly across ordinary scheduling.

  • Payroll and timesheetsclock-in and clock-out times are converted into decimal hours worked, often with overnight shifts to handle correctly.
  • Overnight shift schedulinghospitals, security and manufacturing sites routinely schedule shifts that start on one calendar day and end on the next.
  • Travel and flight durationsa departure and arrival time alone do not reveal the trip length without knowing whether a time zone or a midnight crossing is involved.
  • Fractional-hour billingconsultants, contractors and legal professionals frequently invoice in tenths or quarters of an hour rather than whole hours.

Why an hour has sixty minutes at all

The 24-hour day and the 60-minute hour are older than almost any other unit of measurement still in everyday use, and they come from two different ancient sources layered on top of each other. Dividing the day into 24 hours traces back to ancient Egypt, which split daylight and nighttime into twelve parts each using sundials and star charts. Dividing each of those hours into 60 minutes, and each minute into 60 seconds, is generally traced to the base-60 counting system used by ancient Babylonian mathematicians and astronomers, a system well suited to fractions because 60 divides evenly by so many small numbers. Both conventions were carried forward through Hellenistic astronomy and, from there, into the timekeeping standards the whole world still uses today.

What this assumes, and where it stops

Assumptions

  • Both times are on the same clock — no time zone change between them.

Limitations

  • Does not account for daylight-saving transitions, which add or remove an hour on the days they occur.

Common questions

How do I calculate hours worked for a timesheet?

Enter your clock-in and clock-out times in the duration mode. The decimal hours figure is what most payroll systems want — 8 hours 30 minutes becomes 8.5, not 8.30, which is a common source of timesheet errors when people convert by hand.

How does the calculator know an overnight shift crossed midnight?

If the end time reads earlier on the clock than the start time — say, clocking in at 10 PM and out at 6 AM — it is automatically treated as finishing the next day, since an end time "before" the start otherwise makes no sense. You can also set it explicitly with the midnight-crossing switch if you need to override that assumption.

Formula and content last reviewed on .

Results are estimates for information only, not professional advice.

Report an error

Tools people commonly use alongside the time duration calculator.

See all date & time calculators →