Time Duration Calculator
Calculate the exact hours, minutes, and seconds passed between two times.
Total Duration
Alternative Units
How to Use
Enter your start time
Input the start time using hours and minutes in 24-hour or 12-hour format.
Enter your end time
Input the end time — if it's before the start time, an overnight span is automatically calculated.
Read the duration breakdown
See the result in hours:minutes:seconds format, total minutes, and decimal hours.
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?▼
What is the difference between duration in minutes and decimal hours?▼
Can I calculate durations longer than 24 hours?▼
How do I calculate total hours for a work week from daily durations?▼
How is time duration used in computing and APIs?▼
Related Tools
Explore other tools in this category.
Age Calculator
Calculate your exact age in years, months, and days based on your date of birth.
Age in Days & Hours
Find exactly how old you are in years, months, weeks, days, hours, and minutes.
Countdown Timer
Set a custom countdown with hours, minutes, and seconds. Pause, resume, and use quick presets.
Timezone Converter
Convert any date and time between world timezones. Includes a live clock mode and multi-zone comparison.
Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and vice versa. Shows a live current timestamp.
Date Difference Calculator
Find the exact chronological difference in years, months, and days between two historical or future dates.