Time Duration Calculator

Calculate the exact hours, minutes, and seconds passed between two times.

Total Duration

8 hr0 min

Alternative Units

Total Minutes480
Total Seconds28,800

How to Use

1

Enter your start time

Input the start time using hours and minutes in 24-hour or 12-hour format.

2

Enter your end time

Input the end time — if it's before the start time, an overnight span is automatically calculated.

3

Read the duration breakdown

See the result in hours:minutes:seconds format, total minutes, and decimal hours.

4

Use decimal hours for billing

Copy the decimal hours value directly into payroll or invoicing software.

What is Elapsed Time?

Elapsed time is the total duration that occurs from a starting event to its conclusion. This calculator seamlessly accounts for overnight duration shifts passing midnight.

Real-World Examples & Use Cases

Employee Timesheets and Payroll

Calculating work hours for hourly employees requires precise time arithmetic. Shifts starting at 8:45 AM and ending at 5:20 PM yield 8 hours 35 minutes = 8.583 decimal hours. Payroll software that accepts decimal hours needs this conversion. Night shift workers clocking in at 10 PM and out at 6:30 AM have an 8.5-hour shift that crosses midnight — a calculation that simple subtraction gets wrong. A time duration calculator handles both standard and overnight shifts correctly.

Freelancer Billing and Project Time Tracking

Consultants and freelancers billing by the hour need accurate duration calculations for client invoices. A meeting from 2:15 PM to 3:50 PM is 1 hour 35 minutes = 1.583 hours. At $150/hour, that's $237.50. Tracking multiple work sessions across a day (9:00–11:30, 1:15–3:45, 4:30–5:00) requires adding individual durations accurately. Time duration calculation helps freelancers build precise time logs that justify billing amounts.

Sports and Fitness Timing

Athletes and coaches track elapsed times for performance analysis. A running session from 6:15 AM to 7:42 AM is 1 hour 27 minutes. Comparing this week's total training hours against last week requires accurate duration arithmetic. Swim splits, cycling segments, and interval training blocks each have specific durations that must be summed for total training volume. Race timing, heat durations, and rest interval tracking all depend on time duration calculations.

Shipping, Transit, and Travel Time

Logistics professionals and travelers need to calculate transit durations. A flight departing at 23:30 (11:30 PM) and landing at 07:15 (7:15 AM) the next day has a duration of 7 hours 45 minutes — an overnight calculation. Trucking dispatch needs to know how many hours a driver has been on the road since their last break for Hours of Service compliance. Package transit time SLAs measured in hours require accurate duration calculation from pickup to delivery timestamps.

How It Works

Time Duration Formula: Basic calculation: duration = endTime - startTime (in total minutes or seconds) For 24-hour time: 1. Convert both times to total minutes from midnight: totalMinutes = hours × 60 + minutes 2. Subtract start from end: duration = endTotalMinutes - startTotalMinutes 3. If result is negative (overnight span): duration = duration + 1440 (add 24 hours = 1440 minutes) Convert result to hours:minutes: hours = Math.floor(duration / 60) minutes = duration % 60 Decimal hours (for billing): decimalHours = duration / 60 Example (overnight shift): Start: 22:30 → 22×60 + 30 = 1350 minutes End: 06:15 → 6×60 + 15 = 375 minutes 375 - 1350 = -975 (negative → add 1440) Duration = -975 + 1440 = 465 minutes = 7 hours 45 minutes = 7.75 decimal hours For seconds precision: Convert all times to total seconds, apply same algorithm, then convert result: hours = floor(s/3600), minutes = floor((s%3600)/60), seconds = s%60

Frequently Asked Questions

How does the calculator handle times crossing midnight?
When the end time is earlier than the start time (e.g., start 23:00, end 05:00), the calculator adds 24 hours (1440 minutes) to the result. This correctly calculates overnight durations. So 23:00 to 05:00 = 05:00 - 23:00 = -18 hours + 24 hours = 6 hours. This handles standard overnight shifts, late-night events, and any duration that spans the midnight boundary.
What is the difference between duration in minutes and decimal hours?
Duration in minutes is the raw total: 2 hours 30 minutes = 150 minutes. Decimal hours express the same duration as a decimal number: 150 minutes ÷ 60 = 2.5 hours. Payroll software and billing systems typically accept decimal hours (2.5 hours × $100/hour = $250). If you need to enter time in H:MM format, use the hours and minutes output. For spreadsheet calculations and rate multiplication, use decimal hours.
Can I calculate durations longer than 24 hours?
A time-duration calculator focused on time-of-day inputs (hours and minutes within a single day) typically handles durations up to 24 hours. For durations spanning multiple days (like 3 days, 4 hours, 22 minutes), use a date-difference calculator that accepts full date and time inputs. Multi-day duration calculations require knowing the specific dates because of daylight saving time changes that can make a 24-hour period actually 23 or 25 hours.
How do I calculate total hours for a work week from daily durations?
Calculate each day's duration separately (start time to end time, minus any unpaid break time), then sum the daily durations. Example: Mon 8h15m + Tue 7h45m + Wed 8h30m + Thu 8h00m + Fri 7h30m. To add durations: sum all minutes first (15+45+30+0+30=120min=2h), sum all hours (8+7+8+8+7=38h), total = 38+2 = 40 hours. Alternatively, convert each daily duration to minutes, sum them, then convert back: 40 hours = 2400 minutes.
How is time duration used in computing and APIs?
In software, time durations are typically calculated using Unix timestamps (milliseconds since January 1, 1970 UTC). Subtract start timestamp from end timestamp to get duration in milliseconds, then divide by 1000 for seconds, 60000 for minutes, 3600000 for hours. Most programming languages have built-in date libraries (JavaScript's Date, Python's datetime, Java's Duration) that handle time arithmetic including daylight saving time transitions, which can make durations deceptively tricky around clock change weekends.

Related Tools

Explore other tools in this category.

Looking for something else?