Time calculator
Time Duration Calculator
Find the elapsed time between two decimal-hour clock times.
Use 0–24 decimal hours. An end earlier than the start is treated as the next day.
Duration
—
What the two fields expect
Both fields take a clock time written as decimal hours on a 24-hour scale, not an H:M pair. 10:30 PM is entered as 22.5, and 6:15 AM is entered as 6.25. Each field accepts anything from 0 through 24; a value below 0 or above 24 is rejected and the result stays blank, since there is no 25th hour on a single day's clock.
If the end time is numerically smaller than the start time, the tool assumes the span crosses midnight rather than reporting a negative duration. A start of 22 (10 PM) and an end of 6 (6 AM) is read as an overnight stretch, not as a mistake.
How the duration is calculated
Adding 24 before taking the remainder is what lets the formula handle a wraparound without a separate rule. From 22.5 to 1.25, the raw difference is 1.25 − 22.5 = −21.25; adding 24 gives 2.75, and 2.75 mod 24 is still 2.75, which the calculator reports as 2 hr 45 min (0.75 × 60 = 45).
For a same-day span the addition and modulo cancel out harmlessly: from 9 to 17.5, (17.5 − 9 + 24) mod 24 = 32.5 mod 24 = 8.5, shown as 8 hr 30 min. An overnight security shift from 22 to 6 comes out to (6 − 22 + 24) mod 24 = 8 mod 24 = 8 hr 0 min.
Where decimal-hour entries go wrong
A clock time like 7:30 typed literally into the field is not a valid decimal number, so the field simply won't produce a result — you have to convert it to 7.5 first (30 ÷ 60 = 0.5). Typing whole hours without the AM/PM conversion is the other common slip: 2 means 2 AM on this 0–24 scale, so 2 PM has to be entered as 14.
Setting the start and end to the same value always reports 0 hr 0 min, never a full day. That is a direct consequence of the modulo formula: (24 − 0 + 24) mod 24 also equals 0, so there is no combination of inputs that produces a 24-hour result. This tool measures elapsed time within a wraparound day, not multi-day totals.
Everyday duration checks
A few spans worked out from the same formula:
- Day shift, 9 to 17.5 (9:00 AM to 5:30 PM) → 8 hr 30 min
- Overnight shift, 22 to 6 (10:00 PM to 6:00 AM) → 8 hr 0 min
- Red-eye flight, 23.75 to 6.25 (11:45 PM to 6:15 AM) → 6 hr 30 min
- Evening movie, 19.5 to 21.75 (7:30 PM to 9:45 PM) → 2 hr 15 min
- Study block, 14.25 to 16.75 (2:15 PM to 4:45 PM) → 2 hr 30 min
- Gym session, 6 to 7.25 (6:00 AM to 7:15 AM) → 1 hr 15 min
Frequently asked questions
How do I enter a time like 7:45 PM?
Convert the minutes to a fraction of an hour and add it to the 24-hour form: 45 ÷ 60 = 0.75, and 7 PM is 19 on a 24-hour scale, so 7:45 PM becomes 19.75.
Why does entering the same start and end time give 0 instead of 24 hours?
The formula (End − Start + 24) mod 24 always reduces an equal start and end to 0, including 0 entered against 24, since 24 mod 24 is also 0. The calculator has no way to output a full 24-hour span.
What happens if I type a value above 24 or a negative number?
The field rejects it and the result stays blank. Only values from 0 through 24 represent a real point on a single day's 24-hour clock.
Can this calculator handle a shift that crosses midnight?
Yes. Whenever the end value is smaller than the start value, the formula automatically treats it as the next day — a start of 22 and end of 6 returns 8 hr 0 min instead of a negative number.
Why does 2.75 decimal hours show as 2 hr 45 min?
The whole-number part becomes hours and the remainder is converted to minutes: floor(2.75) = 2 hours, and (2.75 − 2) × 60 = 45 minutes.
Does the calculator account for seconds?
No. Input and output are both limited to decimal hours, so the smallest difference it can show comes from however many decimal places you enter, rounded to whole minutes in the hr/min result.