Time Duration Calculator

Enter a start time and an end time to instantly calculate the duration between them. Works across midnight and handles hours, minutes, and seconds.

Time Duration Calculator

How It Works

The calculator converts both times to total seconds since midnight, subtracts the start from the end, and converts the difference back into hours, minutes, and seconds. If the end time is earlier than the start time, it automatically adds 24 hours to handle overnight durations.

The Formula

Duration = End Time − Start Time (in seconds), then converted to h / m / s.

For overnight durations: Duration = (End Time + 86,400) − Start Time

Example Calculations

StartEndDuration
9:00 AM5:00 PM8h 0m 0s
8:30 AM12:45 PM4h 15m 0s
10:00 PM6:30 AM (next day)8h 30m 0s
7:15:30 AM3:45:00 PM8h 29m 30s
12:00 PM12:00 AM12h 0m 0s

Frequently Asked Questions

How do I calculate time duration manually?

Subtract the start time from the end time. If the minutes in the end time are smaller than the start, borrow 60 minutes from the hours. For example, 4:50 PM to 7:20 PM: borrow 1 hour, giving 80 − 50 = 30 minutes, and 6 − 4 = 2 hours. Result: 2h 30m.

What does “overnight” mean in this calculator?

If your end time is on the following day (past midnight), check the overnight box. For example, a shift from 10:00 PM to 6:00 AM crosses midnight. The calculator adds 24 hours to the end time to give the correct 8-hour result.

Can I calculate duration in decimal hours?

Yes. The result breakdown shows the duration in decimal hours (e.g., 8h 30m = 8.5 hours). This is useful for payroll or billing calculations where time is recorded as a decimal.

How many seconds are in an hour?

There are 3,600 seconds in one hour (60 seconds × 60 minutes). A full day has 86,400 seconds (3,600 × 24).

What is the difference between elapsed time and duration?

Elapsed time usually refers to time that has already passed, while duration is the length of a time interval between any two points. In practice, both terms are used interchangeably.