Calculate time between two times
Enter start and end time to find the duration.
Start time
End time
Calculate time duration
between two times.
Enter a start time and end time to instantly get the duration in hours, minutes, seconds, decimal hours, and total minutes. Handles overnight shifts automatically.
Step by step
How to use the Time Duration Calculator
Enter start time
Type the hours, minutes, and seconds for your start time.
Enter end time
Type the hours, minutes, and seconds for your end time. For overnight shifts, just enter the end time as-is.
Click Calculate
Hit Calculate Duration to instantly see the result in all formats.
Read the result
Get the duration as HH:MM:SS, decimal hours, total minutes, and total seconds.
Why use this calculator?
Payroll & timesheets
Convert clock-in and clock-out times to decimal hours for payroll systems and billing software.
Overnight shifts
Night shift workers can calculate shift length even when the end time is the next day — the calculator wraps around midnight automatically.
Event & race timing
Find the exact duration of a race, training session, meeting, or any timed event from start to finish.
How time duration is calculated — formula and examples
Time duration calculations appear simple but become error-prone at month and day boundaries, especially for overnight shifts. The most reliable approach is to convert everything to a single unit (seconds), perform the arithmetic, then convert back. This eliminates the need to manually carry over minutes to hours or handle the midnight boundary.
For payroll and billing, decimal hours are the standard format because they can be multiplied directly by an hourly rate. 7 hours 45 minutes = 7.75 decimal hours. At ₹500/hour, that is ₹3,875 — no conversion needed. Most spreadsheet and accounting tools expect decimal hours, so knowing how to convert from HH:MM to decimal is a practical skill for anyone who bills by the hour.
Formula
Duration = End time (seconds) − Start time (seconds) | If negative: add 86,400 (midnight wrap)
Both times are converted to total seconds from midnight. The difference gives the duration in seconds, which is then broken down into hours, minutes, and seconds. Decimal hours = total seconds ÷ 3600. If the end time is before the start time, 86,400 seconds (one full day) is added to handle overnight durations.
Worked example
Start: 09:15:00 = 33,300 sec. End: 17:45:30 = 63,930 sec. Duration = 63,930 − 33,300 = 30,630 sec = 8h 30m 30s = 8.508 decimal hours = 510.5 total minutes. Overnight: Start 22:00 (79,200 sec), End 06:30 (23,400 sec). Duration = 23,400 − 79,200 = −55,800 + 86,400 = 30,600 sec = 8h 30m 0s.
Related tools