HomeMathTime Duration Calculator
⏱️ Math & Everyday

Time Duration Calculator

Calculate the exact hours, minutes, and seconds between any two times. Perfect for calculating work hours, shift lengths, and time intervals. Handles overnight shifts automatically.

Calculate Time Duration
8h 30m
from 9:00 AM to 5:30 PM
TOTAL HOURS
TOTAL MINUTES
TOTAL SECONDS
DECIMAL HOURS
Common work shifts:
Day Shift
9AM–5PM
8 hrs
Standard
8AM–4:30PM
8.5 hrs
Night Shift
10PM–6AM
8 hrs
Long Day
7AM–7PM
12 hrs
RESULTING TIME

How to Calculate Time Duration

For simple durations: convert both times to minutes from midnight, subtract start from end. If the result is negative, the shift crosses midnight — add 24 × 60 minutes to get the correct duration.

  • 9:00 AM to 5:30 PM: (17×60+30) − (9×60) = 1050 − 540 = 510 minutes = 8 hours 30 minutes
  • 10:00 PM to 6:00 AM (overnight): (6×60) − (22×60) = 360 − 1320 = −960 + 1440 = 480 minutes = 8 hours

Decimal hours are used in payroll systems. 8 hours 30 minutes = 8.5 decimal hours. Convert minutes to decimal by dividing by 60: 30 ÷ 60 = 0.5.

Frequently Asked Questions

How many hours is 8am to 5pm?
8am to 5pm is 9 hours total. If you take a 1-hour lunch break, net working time is 8 hours. Enter these times in the calculator above to verify any time range instantly.
How do I convert minutes to decimal hours for payroll?
Divide the minutes by 60. Examples: 15 min = 0.25 hrs, 30 min = 0.5 hrs, 45 min = 0.75 hrs. So 8 hours 45 minutes = 8.75 hours on a timesheet.
How does the calculator handle overnight shifts?
When the end time is earlier than the start time, the calculator automatically assumes the shift crosses midnight and adds 24 hours to the end time before calculating. A shift from 10pm to 6am correctly shows 8 hours, not -16 hours.