Time Duration Calculator

Calculate the duration between two times in hours and minutes. Add or subtract time from any start time.

Calculate Time Duration

8h 30m

Duration

510

Total minutes

8.50

Decimal hours

Work Hours Reference
Standard workday8 hours (9:00 AM - 5:00 PM)
Standard work week40 hours (5 days × 8 hours)
Part-time (half day)4 hours
Overtime threshold (US)Over 40 hours/week
Work hours in a year2,080 hours (52 weeks × 40 hours)
Work hours in a month~173 hours (2,080 / 12)

Add or Subtract Time

h
m

Result

11:30

09:00 plus 2h 30m

How to Use the Time Duration Calculator

This time duration calculator answers the everyday question of how long between two times. It handles clock math for you: work out elapsed time for a shift, find the time difference in hours between two appointments, sum up study sessions, or compute total minutes for a timed task. Use it as a time between two times calculator, an elapsed time calculator, or an add hours minutes seconds calculator, all in one place.

  1. Enter the start time. Use the time picker or type directly in 24-hour format. For example, 9:15 AM is 09:15 and 5:30 PM is 17:30. The calculator accepts any hour from 00:00 to 23:59.
  2. Enter the end time. Put the later clock reading here. If both times fall on the same day, leave the overnight toggle off. The calculator reads the two fields, converts each to minutes past midnight, and returns the time difference.
  3. Flag cross-midnight shifts. If the end time is earlier on the clock than the start, the shift crossed midnight. Tick the overnight checkbox for a 10:00 PM to 6:00 AM night shift so the tool adds 24 hours before subtracting. Leave it unchecked for same-day spans like 08:00 to 17:00.
  4. Read the three output tiles. The first shows the duration in hours and minutes (8h 15m), the second shows total minutes (495), and the third shows decimal hours (8.25). Pick whichever format matches your timesheet, invoice, or weekly goal.
  5. Optional: add or subtract time. Use the second panel to push a clock time forward or back by a set number of hours and minutes. Handy for finding meeting end times, break reminders, or countdown deadlines.

The duration display is the fastest answer for scheduling. Total minutes is the right column for logging timers and short tasks. Decimal hours is what payroll software, freelance invoicing, and project trackers expect, since 8.25 hours times an hourly rate is one clean multiplication.

How Time Duration Is Calculated

The core idea behind any elapsed time calculator is simple subtraction: convert both clock times into a single unit, subtract, then convert back. Computers usually work in milliseconds since midnight, but the math is easier to follow in seconds or minutes.

Basic duration formula

If you have two timestamps expressed in milliseconds, the duration is end minus start, then divided down into human units:

duration_ms     = end_ms − start_ms
duration_sec    = duration_ms ÷ 1000
duration_min    = duration_sec ÷ 60
duration_hours  = duration_min ÷ 60

Time difference from clock components

When you only have hours, minutes, and seconds (not full timestamps), total the pieces:

total_seconds = (end_hours − start_hours) × 3600
              + (end_min   − start_min)   × 60
              + (end_sec   − start_sec)

That single line is everything a time difference in hours calculator does under the hood. Each hour contributes 3600 seconds, each minute contributes 60 seconds, and the seconds column is already in the right unit.

Handling wrap-around midnight

If the end time is earlier on the clock than the start (a night shift, a red-eye flight, a long server job), the raw subtraction goes negative. Add 86,400 seconds (one full day) to fix it:

if total_seconds < 0:
    total_seconds = total_seconds + 86400  // add 24 × 3600

Example: 22:00 start, 06:00 end. Raw difference is 6 − 22 = −16 hours. Add 24 and you get the correct 8 hours.

Converting total seconds into h:mm:ss

Once you have a single total_seconds number, split it back into hours, minutes, and seconds using floor division and modulo:

h     = ⌊ total_seconds ÷ 3600 ⌋
m     = ⌊ (total_seconds mod 3600) ÷ 60 ⌋
s_rem = total_seconds mod 60

The ⌊ ⌋ symbols mean round down (floor). For 29,715 seconds: h = ⌊29715 ÷ 3600⌋ = 8, remainder 915 seconds. Then m = ⌊915 ÷ 60⌋ = 15, and s_rem = 915 mod 60 = 15. Final reading: 8:15:15.

Decimal hours (the payroll format)

Payroll, freelance invoices, and time tracking apps prefer decimal hours because it multiplies cleanly with an hourly rate. The conversion is just minutes divided by 60:

decimal_hours = hours + (minutes ÷ 60)

5 hours 45 minutes
  = 5 + 45 ÷ 60
  = 5 + 0.75
  = 5.75 hours

Worked example: 9:15 AM to 5:30 PM

start = 9 × 3600 + 15 × 60 = 33,300 seconds
end   = 17 × 3600 + 30 × 60 = 63,000 seconds
total = 63,000 − 33,300 = 29,700 seconds

h = ⌊29700 ÷ 3600⌋ = 8
m = ⌊(29700 mod 3600) ÷ 60⌋ = 15

Duration = 8h 15m
Decimal  = 8 + 15 ÷ 60 = 8.25 hours

Quick reference: common shift durations

StartEndDuration (h:mm)Decimal hours
5:00 AM1:00 PM8:008.00
8:00 AM5:00 PM9:009.00
9:00 AM5:30 PM8:308.50
9:15 AM5:30 PM8:158.25
7:00 AM3:30 PM8:308.50
3:00 PM11:00 PM8:008.00
10:00 PM6:00 AM8:008.00
11:00 PM7:30 AM8:308.50

The last two rows cross midnight. The overnight toggle in the widget adds the 24-hour offset so you do not have to do it by hand.

Insights: Payroll, Time Zones, and DST

Calculating how long between two times looks simple until a lunch break, a flight across time zones, or a daylight saving jump changes the answer. Here is how to handle the cases that trip most people up when they use a time duration calculator for real work.

Payroll context: breaks, rounding, and overtime

US payroll rarely pays you for every clocked minute. Unpaid lunch breaks are subtracted first. A 7:00 AM to 3:30 PM shift with a 30-minute unpaid lunch is 8 hours of clock time but only 8.0 hours of paid time after the break, or 7.5 if the lunch is 60 minutes. Write the raw duration, then subtract break minutes.

Many employers also use the 15-minute (quarter-hour) rounding rule under 29 CFR 785.48. Clock entries are rounded to the nearest 15 minutes using the 7/8 rule: 7 minutes or less rounds down, 8 minutes or more rounds up. Clocking in at 8:07 counts as 8:00, but clocking in at 8:08 counts as 8:15. Applied fairly, it has to round both in your favor and against you over time.

Overtime kicks in past 8 hours in a day (in California and a few other states) or past 40 hours in a workweek (federal FLSA rule). Non-exempt employees get 1.5x their regular rate for overtime hours, and 2x in California past 12 hours in a day.

Clock in / outRaw durationLunchPaid hours (decimal)
8:00 AM / 4:30 PM8h 30m30 min unpaid8.00
7:00 AM / 3:30 PM8h 30m30 min unpaid8.00
9:00 AM / 6:00 PM9h 00m60 min unpaid8.00
6:00 AM / 6:00 PM12h 00m60 min unpaid11.00

Cross time zone durations

The clock lies about elapsed time when you cross time zones. A flight leaves JFK (Eastern) at 11:00 AM and lands at LAX (Pacific) at 2:00 PM. The local clocks say 3 hours, but the flight actually took 6 hours: LA is 3 hours behind New York, so 2:00 PM Pacific is 5:00 PM Eastern. Always convert both ends to the same time zone (or use UTC timestamps) before subtracting.

The safe procedure: note the departure time in the home time zone, note the arrival time in the home time zone, then subtract. Booking systems do this silently when they show a 6h 00m flight time on a ticket.

Daylight saving transitions

Two Sundays a year break the assumption that each hour is 60 minutes long. In spring (second Sunday of March in the US), clocks jump from 2:00 AM to 3:00 AM, so a block labeled 1:30 AM to 3:30 AM is really 1 hour of wall time, not 2. In fall (first Sunday of November), the hour from 1:00 AM to 2:00 AM repeats, so 1:30 AM to 3:30 AM is 3 hours.

For payroll, most employers pay the actual hours worked: 7 hours on spring-forward Sunday and 9 hours on fall-back Sunday for the same labeled shift. Scheduling software that uses UTC under the hood handles this automatically. Paper timesheets do not.

Sleep, work, and study tracking

Pick the format that matches how you add the numbers later. Decimal hours win when you tally a weekly total (37.5 of a 40-hour target, a 7.25-hour sleep average). Hours and minutes win when you schedule individual blocks or read a clock (9:30 AM start, 75-minute focus session, bed by 10:45 PM).

A common hybrid: track each session in hours and minutes for readability, then convert to decimal when you roll up the week. Three sessions of 1h 15m, 0h 45m, and 2h 30m are easier to sum as 1.25 + 0.75 + 2.50 = 4.50 hours than as 1:15 + 0:45 + 2:30 = 4:30.

Frequently Asked Questions

Subtract the start time from the end time. For 9:00 AM to 5:30 PM: from 09:00 to 17:30 is 8 hours and 30 minutes, or 8.5 hours in decimal. The time duration calculator above handles this instantly and also shows total minutes (510). For overnight shifts like 11 PM to 7 AM, tick the overnight toggle so the tool adds 24 hours to the end time before subtracting.

Related Calculators