Time Duration Calculator

Calculate the exact duration between two times or dates. Get hours, minutes, seconds, and decimal format instantly.

Calculate Time Duration

What Is Time Duration Calculation?

Time duration calculation measures the elapsed time between two points—whether two clock times on the same day or a start and end across multiple days. It answers the question: “How much time has passed?” The result is typically expressed in hours, minutes, and seconds, and often in decimal hours for payroll and billing. Understanding how duration calculations work helps you verify timesheets, plan schedules, track workouts, and bill clients accurately.

Duration Calculation Formula

Same-day calculation:

Duration = End Time − Start Time

Convert both to total seconds, subtract, then convert back:

  1. Start seconds = (Start Hours × 3600) + (Start Minutes × 60) + Start Seconds
  2. End seconds = (End Hours × 3600) + (End Minutes × 60) + End Seconds
  3. Duration seconds = End seconds − Start seconds
  4. If Duration ≤ 0 (overnight), add 86,400 seconds

Decimal hours: Duration seconds ÷ 3600 = decimal hours

Worked Examples

Example 1: Standard Workday

Start: 9:00 AM (09:00)   End: 5:30 PM (17:30)

Start seconds: 9 × 3600 = 32,400
End seconds: (17 × 3600) + (30 × 60) = 63,000
Duration: 63,000 − 32,400 = 30,600 seconds
Hours: 30,600 ÷ 3600 = 8 hours 30 minutes (8.5 decimal hours)

Example 2: Overnight Shift

Start: 10:00 PM (22:00)   End: 6:30 AM (06:30)

Start seconds: 22 × 3600 = 79,200
End seconds: (6 × 3600) + (30 × 60) = 23,400
Duration: 23,400 − 79,200 = −55,800 (negative → crosses midnight)
Add 86,400: −55,800 + 86,400 = 30,600 seconds
Result: 8 hours 30 minutes (8.5 decimal hours)

Example 3: Short Meeting with Seconds

Start: 2:15:30 PM (14:15:30)   End: 3:42:15 PM (15:42:15)

Start seconds: (14 × 3600) + (15 × 60) + 30 = 51,330
End seconds: (15 × 3600) + (42 × 60) + 15 = 56,535
Duration: 56,535 − 51,330 = 5,205 seconds
Result: 1 hour 26 minutes 45 seconds (1.45 decimal hours)

Common Use Cases

Work shifts: Employees and employers use duration calculators to verify hours worked. A shift from 9:00 AM to 5:30 PM is 8 hours 30 minutes. Overnight shifts (e.g., 10:00 PM to 6:00 AM) are handled by assuming the end time is the next day.

Travel time: Plan trips by calculating how long a journey takes. A drive from 8:15 AM to 11:45 AM is 3 hours 30 minutes. Multi-day trips can use the optional date inputs for accurate duration across days.

Exercise and fitness: Track workout duration, run times, or how long you have been active. A run from 6:00 AM to 7:22 AM is 1 hour 22 minutes. Seconds matter for precision in athletic timing.

Project tracking and billing: Measure time spent on tasks, meetings, or projects. A meeting from 2:00 PM to 3:30 PM is 1 hour 30 minutes. Decimal hours (e.g., 1.5) make it easy to multiply by hourly rates for billing. Freelancers, consultants, and lawyers frequently use duration calculations to generate accurate invoices.

Quick Reference: Common Durations

Start Time End Time Duration (HH:MM) Decimal Hours
9:00 AM5:00 PM8:008.00
9:00 AM5:30 PM8:308.50
8:00 AM4:30 PM8:308.50
8:30 AM5:00 PM8:308.50
7:00 AM3:30 PM8:308.50
10:00 PM6:00 AM8:008.00
11:00 PM7:30 AM8:308.50
6:00 AM2:30 PM8:308.50
9:00 AM12:00 PM3:003.00
1:00 PM5:00 PM4:004.00

Handling Overnight Calculations

When the end time is earlier than the start time (e.g., 10:00 PM to 6:00 AM), the period crosses midnight. Our calculator detects this automatically: if end time is less than start time, it adds 24 hours to the end time. So 22:00 to 06:00 correctly yields 8 hours. For multi-day spans, the optional date fields provide an exact duration that accounts for all intervening days.

Decimal Hours for Payroll and Billing

Many payroll systems, accounting tools, and billing platforms require time in decimal format rather than HH:MM. Our calculator outputs both formats simultaneously. To convert manually: divide the minutes portion by 60 and add to the hours. For example, 8 hours 45 minutes = 8 + (45 ÷ 60) = 8.75 decimal hours. At $30 per hour, that is 8.75 × $30 = $262.50. Use our Decimal to Time Converter or Time to Decimal Converter for quick conversions.

Lunch Break Deductions

When calculating work duration, remember to deduct unpaid break time. If you work from 8:00 AM to 5:00 PM with a 1-hour unpaid lunch, your paid duration is 8 hours, not 9. Our Work Hours Calculator can handle break deductions automatically. For this duration calculator, simply subtract the break manually from the total, or calculate the duration of each work segment separately and add them together.

AM/PM Considerations

Our calculator uses 24-hour format internally (0–23 for hours), so there is no ambiguity. Whether you think of 2:30 PM or 14:30, the duration is the same. The time inputs use your browser’s locale, but the math is consistent. For multi-day spans, use the optional date fields to get the full duration from start date/time to end date/time.

Common Pitfalls

  • Forgetting date changes: If your shift starts Monday at 11:00 PM and ends Tuesday at 7:00 AM, you must account for the date change. Without date fields, the calculator assumes the shortest positive duration (8 hours), which is correct for single-day or overnight scenarios.
  • Mixing time zones: If your start time is in one timezone and end time is in another (e.g., a cross-country flight), convert both to the same timezone before calculating. Otherwise the duration will be off by the timezone difference.
  • DST transitions: On the day clocks “spring forward,” 2:00 AM to 3:00 AM is only 0 hours (the hour is skipped). On “fall back” day, 1:00 AM to 2:00 AM could be 1 or 2 hours depending on which occurrence. For DST-aware calculations, use dates and let the system handle the transition.

Frequently Asked Questions

A time duration calculator measures the elapsed time between two points in time. It shows the result in hours, minutes, seconds, and decimal hours—useful for work shifts, travel time, exercise tracking, and billing.

When the end time is earlier than the start time (e.g., 10:00 PM to 6:00 AM), the calculator automatically assumes the period crosses midnight and adds 24 hours to get the correct duration. For multi-day spans, use the optional date inputs.

12-hour format uses AM/PM (e.g., 2:30 PM), while 24-hour format uses 0–23 for hours (e.g., 14:30). Our calculator uses 24-hour format internally for consistency. Both produce the same duration result.

Yes. Use the optional Start Date and End Date fields. When dates differ, the calculator computes the full duration from the start date/time to the end date/time, including all days in between.
Written & Reviewed by Experts
SM
Author

Sarah Mitchell, CPA

Certified Public Accountant • 12+ yrs payroll & workforce analytics

Specializes in time management, payroll compliance, and workforce optimization. Helped 500+ businesses streamline time-tracking.

DC
Fact-Checker

David Chen, MBA

Finance & Operations • MBA, Wharton

Specializes in financial modeling, regulatory compliance, and data accuracy verification across payroll and tax systems.

Embed This Calculator on Your Website