Time Duration Calculator - Calculate Time Between Two Times
Calculate the duration between two times. Perfect for tracking work hours, meeting lengths, travel time, and any time interval. Handles overnight durations automatically.
Reviewed by the Calcura editorial team · Last reviewed
- Question
- How do I calculate the duration between two times?
- Answer
- duration = |end − start| in minutes. Convert each time to minutes past midnight (hours × 60 + minutes), subtract, then convert back. If the end is earlier than the start, add 24×60 minutes to handle overnight (e.g., 10 PM to 6 AM = 8 hours). Payroll typically wants decimal hours (8.25 rather than 8h 15m), so also divide the total minutes by 60.
▸Show formula & caveatsHide formula & caveats
- Formula
duration = |end − start|; add 24h if end < start (overnight shift)- Caveats
- Time format matters — 1:30 PM and 13:30 are the same; 1:30 alone is ambiguous.
- Daylight-saving transitions: on spring-forward day, 2:30 AM doesn't exist — a shift across that boundary is 1 hour shorter.
- Don't subtract strings — convert to minutes first, or use a proper Date/duration library.
What This Calculator Does
This calculator finds the exact duration between two clock times. Enter a start time and end time in 24-hour format and it returns the difference in hours, minutes, and decimal hours — useful for tracking billable work, calculating shift length, timing meetings, or measuring any interval. When the end time is earlier than the start time (10 PM to 6 AM, for example), the calculator treats it as crossing midnight and adds 24 hours automatically. Decimal hours (8.25 rather than 8h 15m) are the format most payroll and invoicing systems accept.
When To Use This Calculator
Tracking Billable Work Hours
You're a freelance consultant who started work at 9:15 AM and finished at 3:45 PM. Calculate the duration: 6 hours 30 minutes (6.5 hours). At $125/hour, that's $812.50 to invoice.
Calculating Overtime Pay
An employee clocked in at 7:30 AM and out at 6:15 PM with a 30-minute lunch break. Duration: 10 hours 45 minutes. Minus 30 minutes lunch = 10.25 hours. Subtract 8 regular hours = 2.25 hours overtime at 1.5x pay rate.
Planning Meeting Schedules
You need to fit 3 meetings into your afternoon. Meeting 1: 1:00-2:15 PM (1h 15m), Meeting 2: 2:30-3:45 PM (1h 15m), Meeting 3: 4:00-5:00 PM (1h). Total: 3.5 hours of meetings between 1:00-5:00 PM.
Calculating Night Shift Duration
A shift starts at 10:00 PM and ends at 6:00 AM the next morning. The calculator automatically detects this crosses midnight and calculates correctly: 8 hours.
How It Works
This calculator converts both times into total minutes since midnight, then subtracts the start from the end to get duration in minutes. For example, 9:00 AM becomes 540 minutes (9 × 60), and 5:00 PM becomes 1,020 minutes (17 × 60). The difference is 480 minutes, which converts to 8 hours. When the end time is earlier than the start time (like 10 PM to 2 AM), the calculator adds 24 hours (1,440 minutes) to the end time, recognizing it's the next day. This ensures overnight shifts calculate correctly. The result is then converted into hours and minutes, decimal hours (for billing), and human-readable format.
Formula
Duration (minutes) = (End Hour × 60 + End Minutes) - (Start Hour × 60 + Start Minutes) • If result is negative, add 1,440 minutes (24 hours)Real-World Example
Scenario
Jordan works as a nurse with a shift starting at 7:00 PM (19:00) and ending at 7:00 AM (07:00) the next day. The schedule includes a 30-minute break that should be subtracted from total hours for payroll.
Calculation
Start time: 19:00 (7:00 PM) End time: 07:00 (7:00 AM next day) Step 1: Convert to minutes Start: 19 × 60 = 1,140 minutes End: 7 × 60 = 420 minutes Step 2: End is earlier, so add 24 hours End adjusted: 420 + 1,440 = 1,860 minutes Step 3: Calculate duration Duration: 1,860 - 1,140 = 720 minutes = 12 hours Step 4: Subtract break Paid hours: 12 hours - 0.5 hours = 11.5 hours
Result
Jordan worked 12 total hours but gets paid for 11.5 hours after subtracting the unpaid break. At $32/hour, the shift pays $368.
Common Mistakes to Avoid
Mistake: Using 12-hour time (AM/PM) instead of 24-hour format
Solution: This calculator uses 24-hour format (also called military time). Convert PM times by adding 12: 1:00 PM = 13:00, 5:30 PM = 17:30, 11:45 PM = 23:45. AM times stay the same except 12:00 AM = 00:00.
Mistake: Forgetting to subtract unpaid breaks from total duration
Solution: This calculator shows total time between start and end. If you have unpaid lunch breaks or other unpaid time, subtract them manually. A 9-hour shift with 30-minute unpaid lunch = 8.5 paid hours.
Mistake: Not accounting for next-day durations correctly
Solution: The calculator handles this automatically. If you enter 22:00 to 06:00, it knows you mean overnight and calculates 8 hours. But verify the result matches your expectation—if you meant same-day, adjust your inputs.
Mistake: Rounding time incorrectly for billing
Solution: For billing purposes, know your rounding rules. Some bill in 15-minute increments: 6 hours 12 minutes rounds to 6.25 hours. Others use exact minutes: 6 hours 12 minutes = 6.2 hours. Check your contract or employer policy.
Time Duration vs. Related Calculators
Minutes to Hours Calculator
If you already know total minutes (like 375 minutes) and need to convert to hours and minutes (6 hours 15 minutes), use this. Time Duration calculates minutes from start/end times.
Hours to Days Calculator
After calculating duration in hours, use this to see how many days that represents. Useful for project planning: 80 hours of work = 10 eight-hour workdays or 2 work weeks.
Workdays Calculator
For calculating duration in business days (excluding weekends/holidays) rather than hours and minutes. Use this for project deadlines and business timelines.
When This Isn't the Right Tool
Payroll with unpaid breaks
Use instead: Calculate total duration here, then subtract unpaid break time separately. This tool returns the full span between start and end, not net paid hours.
Durations longer than 24 hours
Use instead: This calculator assumes at most one midnight crossing. For multi-day intervals, use a date/time difference calculator that accepts a full timestamp (date + time).
Times across different time zones
Use instead: Convert both times to the same zone first (UTC is usually simplest), then compute the duration. Otherwise daylight-saving transitions and zone offsets will distort the result.
Legal or consulting billing with rounding rules
Use instead: Some professions bill in 6- or 15-minute increments. Take the decimal result and round according to your engagement's agreement — the calculator reports the exact duration, not the billable duration.
How to Verify This Calculation
Spot-check a simple case: 09:00 to 17:00 must equal 8.00 hours. For overnight checks, 22:00 to 06:00 must equal 8.00 hours. In Google Sheets or Excel, the formula =(end-start+IF(end<start,1,0))*24 returns decimal hours and should match this calculator.
Sources
- U.S. Department of Labor — Hours Worked Under FLSA — Official guidance on what counts as compensable work time, including breaks, waiting time, and on-call hours.
- NIST — Time and Frequency Division — U.S. national standards for timekeeping and time services.
- ISO 8601 — Date and Time Format — International standard for representing dates and times (HH:MM:SS, date intervals, durations).
Reviewed by the Calcura editorial team · Last reviewed