DATE & TIME / NO. 004 FREE ONLINE TOOL

Time duration
calculator.

Work out the time between two clock times or two date-and-time points. Overnight shifts are handled, breaks are deducted, and the result is shown in hours and minutes and in decimal hours for timesheets.

01 / YOUR INPUTSUPDATES AS YOU TYPE

Loading calculator…

02 / YOUR RESULT LIVE
CALCULATED ANSWER
—

HOW IT WAS CALCULATED
THE EXPLANATION / 01

Hours and minutes,
counted properly.

THE RULES WE USE
  • Times use the 24-hour clock (00:00 to 23:59:59). Your device may show AM/PM pickers; the result is the same.
  • In “Auto” mode, an end time earlier than the start time is treated as the next day.
  • Equal start and end times give 0 in Auto mode. Choose “Next day” for a full 24 hours.
  • The unpaid break is subtracted from the elapsed time.
  • Decimal hours = total minutes ÷ 60, shown to two decimal places in the summary and more precisely in the details.
  • Clock arithmetic: daylight-saving clock changes are not applied.

How do you calculate the time between two times?

Convert both times to minutes after midnight, then subtract. 9:00 is 540 minutes and 17:30 is 1,050 minutes, so the difference is 510 minutes: 8 hours 30 minutes. If the end time is earlier than the start, the period crosses midnight, so add 24 hours (1,440 minutes) before subtracting.

minutes = (end − start) mod 1440 − break
hours   = minutes ÷ 60

How do decimal hours work?

Payroll and timesheet systems usually want hours as a decimal number. Divide the minutes by 60: 15 minutes is 0.25 hours, 30 minutes is 0.5 hours and 45 minutes is 0.75 hours. So 7 hours 45 minutes is 7.75 hours, not 7.45. Mixing up the two is one of the most common timesheet errors.

What about shifts longer than a day?

Switch to Two dates and times and enter the start and end dates as well as the times. The calculator then measures the complete span, for example from Friday afternoon to Monday morning, and still subtracts any break you enter.

Why is daylight saving time not included?

When clocks change, a night shift can actually be an hour shorter or longer than the clock times suggest. Applying that correctly requires a specific location and date. The calculator does clock arithmetic only, which is what most timesheets record. If a shift crossed a clock change, add or subtract that hour yourself.

WORKED EXAMPLES / 02EACH ONE IS CHECKED BY OUR TEST SUITE

Worked examples.

01

A standard working day

08:45 to 17:15 with a 45-minute unpaid lunch break.

7 h 45 min, which is 7.75 decimal hours.

Load this example
02

A night shift

22:00 to 06:30 with a 30-minute break. The end time is earlier than the start, so it is treated as the next morning.

8 h 00 min (8.00 hours).

Load this example
03

A full 24-hour period

From 07:00 to 07:00 the next day, without a break.

24 h 00 min. Choose “Next day”, because in Auto mode equal times mean zero.

Load this example
04

Across several days

From Friday 6 November 2026 at 14:00 to Monday 9 November 2026 at 09:30.

67 h 30 min, which is 67.5 hours (2 days, 19 hours and 30 minutes).

Load this example
LIMITS / 03

What this calculator
does not do.

  • It does not apply daylight-saving changes or time zones. Times are treated as readings on the same clock.
  • It does not apply payroll rounding rules (such as rounding to the nearest quarter hour) or decide which breaks are paid. Those depend on your employer and the law where you work.
  • Only deduct breaks that are genuinely unpaid. Under U.S. federal rules, short rest breaks (usually 20 minutes or less) count as hours worked; bona fide meal periods (typically 30 minutes or more, fully relieved from duty) generally do not.
  • It measures one period at a time. For a weekly timesheet, calculate each day and add the decimal hours.
QUESTIONS / 04SHORT ANSWERS

Common questions.

How many hours is 9 to 5?

8 hours, or 7.5 hours after a 30-minute unpaid break.

How do I convert minutes to decimal hours?

Divide by 60. For example 20 minutes is 0.333… hours, and 45 minutes is 0.75 hours.

How do I calculate an overnight shift?

Enter the start and end times as normal. In Auto mode, an end time earlier than the start time is counted on the next day.

Can it handle seconds?

Yes. Times can include seconds (HH:MM:SS), and seconds are shown when the result has them.

SOURCES & METHOD / 05REVIEWED NOVEMBER 2026
  1. U.S. Department of Labor — Fact Sheet #22: Hours Worked under the FLSA — short rest breaks count as hours worked; bona fide meal periods generally do not
  2. Python documentation — datetime.timedelta — naive date-time arithmetic, the same model used here

The calculation runs in your browser using whole seconds and integer arithmetic, so there is no rounding drift. Tests cover midnight crossings, equal times, one-minute spans, breaks longer than the shift, invalid times and multi-day date-time spans.