CCalculator Planet
Time Duration

Calculate time between two times

Enter start and end time to find the duration.

Start time

End time

⏱️ Time tool

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.

Hours & minutesDecimal hoursOvernight shiftsPayroll & billingFree & instant

Step by step

How to use the Time Duration Calculator

1

Enter start time

Type the hours, minutes, and seconds for your start time.

2

Enter end time

Type the hours, minutes, and seconds for your end time. For overnight shifts, just enter the end time as-is.

3

Click Calculate

Hit Calculate Duration to instantly see the result in all formats.

4

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

Explore more calculators

What is a Time Duration Calculator?

A time duration calculator finds the exact elapsed time between a start time and an end time — expressed in hours, minutes, seconds, total minutes, total seconds, and decimal hours. It is more reliable than mental arithmetic because it handles edge cases like durations that cross midnight, and it converts the result into multiple useful formats simultaneously.

Whether you are tracking work hours, calculating shift lengths, billing a client by the hour, timing an event, or converting a duration for a timesheet, this calculator gives you the precise answer in seconds.

🕐

Hours, minutes & seconds

Get the full breakdown in H:MM:SS format as well as total minutes and total seconds.

🌙

Overnight durations

If the end time is before the start time, the calculator automatically wraps around midnight.

💼

Decimal hours

Decimal hours (e.g. 7.5 hours) are shown for payroll, billing, and timesheet use.

How Time Duration is Calculated

Both times are converted to total seconds from midnight (00:00:00), then subtracted. If the result is negative (end time is before start time), 86,400 seconds (one full day) is added to account for the overnight wrap.

Formula

Duration (sec) = End time (sec) − Start time (sec)

If negative: Duration = Duration + 86,400

To convert back: Hours = ⌊Duration ÷ 3600⌋ · Minutes = ⌊(Duration mod 3600) ÷ 60⌋ · Seconds = Duration mod 60

Worked Example

Example 1 — Same day

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

Example 2 — Overnight shift

Start: 22:00:00 → 79,200 sec · End: 06:30:00 → 23,400 sec

Duration = 23,400 − 79,200 = −55,800 → +86,400 = 30,600 sec = 8h 30m 0s

Common Uses for Time Duration Calculations

Payroll and timesheets

Employees and freelancers need to record exact hours worked per day. Converting clock-in and clock-out times to decimal hours (e.g. 7.75 hours instead of 7h 45m) is required for most payroll systems and invoicing software.

Client billing by the hour

Consultants, lawyers, designers, and other professionals who bill by the hour need precise duration tracking. A 15-minute rounding error on a ₹5,000/hour rate costs ₹1,250 per session.

Shift scheduling

Managers planning shift rosters need to verify that each shift meets minimum hour requirements and that overnight shifts are calculated correctly across the midnight boundary.

Sports and event timing

Race times, match durations, training session lengths, and event schedules all require precise time arithmetic. Converting a finish time minus a start time into hours, minutes, and seconds is a direct application of this calculator.

Travel and logistics

Flight durations, driving time estimates, delivery windows, and transit schedules are all expressed as time durations. Knowing the exact hours and minutes between departure and arrival helps with planning connections and layovers.

Time Format Conversions — Quick Reference

The same duration can be expressed in several formats depending on the context. The table below shows common conversions for reference.

HH:MM:SSDecimal HoursTotal MinutesTotal Seconds
0:15:000.2515900
0:30:000.50301,800
0:45:000.75452,700
1:00:001.00603,600
1:30:001.50905,400
2:00:002.001207,200
4:00:004.0024014,400
7:30:007.5045027,000
8:00:008.0048028,800
8:30:008.5051030,600
12:00:0012.0072043,200
24:00:0024.001,44086,400

Converting minutes to decimal hours

Decimal hours = Hours + (Minutes ÷ 60) + (Seconds ÷ 3600). For example, 7 hours 45 minutes = 7 + (45 ÷ 60) = 7 + 0.75 = 7.75 decimal hours. This is the format most payroll and billing systems expect.

Frequently Asked Questions