toooly-box

Time Duration Calculator

Two times in, the span between them out: in every form you might need it.

runs locally
Time between two timesBoth times on a 24-hour clock.
8:30hours
Decimal hours8.50
Minutes510

How do you work out the time between two times?

Convert both times to minutes from midnight, subtract, and convert back. 09:15 to 17:40 is 555 minutes to 1,060 minutes, so 505 minutes, which is 8 hours 25 minutes or 8.42 decimal hours. If the end is earlier than the start, the span crosses midnight and a day is added.

How it works

The span is the end minus the start, in minutes, which is then shown three ways: hours and minutes, total minutes, and decimal hours.

When the end is earlier than the start, the span is taken as running past midnight. 23:30 to 00:15 is forty-five minutes, not minus twenty-three hours.

There is no break field and no notion of work here. This is the plain distance between two points on a clock, which is a different question from how long someone was working.

What a time duration is

A time duration is the distance between two points on a clock, measured forward from the first to the second. It is a quantity, not a time of day: 8:30 as a duration means eight hours and thirty minutes, while 8:30 on a clock means half past eight in the morning. Written down the two are identical, and most of the errors in this arithmetic come from treating one as the other.

Measuring one is a subtraction, but not of the digits as they are written. Clock time runs in base sixty inside base twenty-four, so 17:40 minus 09:15 cannot be done column by column the way 1740 minus 915 can. The method that always works is to convert both times to minutes from midnight, 555 and 1,060, subtract to get 505, and convert back: 8 hours 25 minutes, or 8.42 decimal hours.

Duration is also what separates this from a time difference between zones and from a calculation across dates. The gap between 09:00 in London and 09:00 in Rome is an offset, not a duration; the gap between two dates is counted in days. A duration in this sense lives inside a single turn of the clock, which is why it wraps at midnight rather than going negative.

duration = end in minutes from midnight − start in minutes from midnight09:15 to 17:40: 1,060 − 555 = 505 minutes, or 8h 25m, or 8.42 decimal hours.

Three answers, because the question has three uses

A duration is wanted in a different unit depending on what happens to it next, and converting between them by hand is where the errors get in.

  • Hours and minutes 8:30. The form to read, to write on a form, and to compare against a clock.
  • Total minutes 510. The form to add up, because minutes add correctly and clock times do not: 2:45 plus 2:45 is not 4:90.
  • Decimal hours 8.5. The form to multiply by a rate, a price or a capacity. This is the one that is wrong if you write 8.30 for eight hours thirty.

Why a span that crosses midnight is not negative

A clock is a circle, so "later" is not the same as "a bigger number". 23:30 to 00:15 goes forward forty-five minutes even though 00:15 is numerically smaller. Subtracting naively gives minus twenty-three hours and fifteen minutes, which is the answer to a different question.

This calculator takes the forward direction, which is what people mean when they give two times in order. It is the right reading for a night shift, a flight that lands the next day, a process that runs overnight, a cooking time that starts in the evening. If you genuinely want the backward span, swap the two times.

What this is for, and what it is not

  • It is for how long a meeting ran, how long a process took, how far apart two timestamps are, the length of a flight, how long something has been in the oven.
  • It is not a work-hours calculator there is no break to deduct. If the span includes an unpaid lunch, use the hours worked calculator, which takes the break off.
  • It is not a date calculator both times are read as being on the same day, or on consecutive days when the span wraps. For a duration measured in days, use the business days calculator.
  • It does not know about time zones two times in different zones are not comparable as written. Convert them to one zone first, then measure.

Adding durations without getting it wrong

The classic failure is adding clock times directly. Two spans of 2:45 are not 4:90; they are 5:30, because sixty minutes carry into an hour. A spreadsheet will do this correctly only if the cells are formatted as durations rather than as times of day, which is why the total of a timesheet column so often comes out wrong on the first attempt.

The reliable method is to convert to minutes, add, then convert back, which is exactly what this tool shows you: take the total-minutes figure for each span, sum those, and divide by 60 at the very end. Converting each span to decimal hours first and rounding as you go is the other common source of a total that is a few minutes short.

Questions people ask

How many hours are between two times?

Subtract the start from the end in minutes, then divide by 60. From 09:15 to 17:45 is 510 minutes, which is 8 hours 30 minutes, or 8.5 decimal hours.

What if the end time is earlier than the start?

The span is read as crossing midnight, so 23:30 to 00:15 is forty-five minutes. Swap the two times if you wanted the span the other way round.

Why do my durations add up wrong in a spreadsheet?

Because the cells are formatted as times of day rather than durations, so the total wraps at 24 hours. Convert each span to minutes, add those, then divide by 60.

Does this take a lunch break off?

No. This is the plain distance between two times. For work hours with an unpaid break deducted, use the hours worked calculator.

Does it handle time zones?

No. Two times written in different zones are not comparable as they stand. Convert them to a single zone first, then measure the span.