Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Time Between Two Times: How to Calculate It

· 5 min read · Home Tech

In this article
  1. Understanding Time Intervals
  2. How to Calculate the Difference Manually
  3. Handling Overnight and Cross-Day Intervals
  4. Using a Calculator for Time Differences
  5. Common Mistakes and How to Avoid Them
  6. Real-World Applications
  7. Frequently Asked Questions

The amount of time between two times is simply the difference between the later time and the earlier time, expressed in hours and minutes (or seconds). To find it, subtract the start time from the end time, and if the end time is on the next day, add 24 hours to the end time before subtracting.

Understanding Time Intervals

A time interval is the duration separating two distinct points on a clock. It is not the same as a time of day—while 9:00 AM is a moment, the interval from 9:00 AM to 10:30 AM is 1 hour and 30 minutes. This distinction matters because intervals are additive: you can add two intervals (e.g., 1h30m + 2h = 3h30m), but you cannot add two times of day in the same way (9:00 AM + 10:30 AM is meaningless).

Time intervals are used everywhere: calculating work hours, cooking durations, travel time, sports performance, and scientific experiments. The most common units are hours and minutes, but seconds are used when precision is needed, such as in racing or laboratory timing.

How to Calculate the Difference Manually

The standard method for finding the time between two times is straightforward. Here are the steps:

  1. Write down the start time and the end time in 24-hour format (e.g., 2:30 PM becomes 14:30).
  2. If the end time is on the next day (e.g., start at 11:00 PM and end at 2:00 AM), add 24 hours to the end time.
  3. Subtract the start time from the end time: subtract hours from hours and minutes from minutes.
  4. If the minutes in the start time are greater than the minutes in the end time, borrow 1 hour (60 minutes) from the hours of the end time.

For example, to find the time between 9:45 AM and 2:20 PM:

  • Convert to 24-hour: 09:45 and 14:20.
  • Subtract: 14 hours 20 minutes - 9 hours 45 minutes.
  • Since 20 minutes is less than 45 minutes, borrow 1 hour from 14, making it 13 hours and 80 minutes.
  • Now subtract: 13 - 9 = 4 hours, and 80 - 45 = 35 minutes.
  • The interval is 4 hours and 35 minutes.

Handling Overnight and Cross-Day Intervals

When the time span crosses midnight, the calculation changes slightly. The key is to treat the end time as being on the next day. For instance, from 10:30 PM to 6:15 AM:

  • Convert to 24-hour: 22:30 and 06:15.
  • Add 24 hours to the end time: 06:15 + 24:00 = 30:15.
  • Subtract: 30:15 - 22:30 = 7 hours and 45 minutes.

This method works because the clock wraps around at midnight. If you are calculating a duration that spans multiple days, you would also add 24 hours for each full day that passes.

Using a Calculator for Time Differences

While manual calculation is useful, many people prefer using an online time duration calculator. These tools typically ask for a start time and an end time, and they instantly return the difference in hours, minutes, and sometimes seconds. Some calculators also allow you to enter dates, which handles overnight and multi-day intervals automatically.

When using such a calculator, ensure you select the correct AM/PM or use 24-hour format to avoid errors. Also, be aware of whether the calculator includes the start time in the count (most do not—they measure the elapsed time from the start to the end).

Common Mistakes and How to Avoid Them

Several pitfalls are common when calculating time differences:

  • Forgetting AM/PM: Mixing up 8:00 AM and 8:00 PM leads to a 12-hour error. Always convert to 24-hour format.
  • Ignoring day rollover: If you subtract 11:00 PM from 1:00 AM without adding 24 hours, you get a negative number. Always add 24 hours to the end time if it is on the next day.
  • Borrowing incorrectly: When subtracting minutes, if the start minutes are larger, you must borrow 60 minutes from the hours. Forgetting this gives a wrong result.
  • Confusing duration with clock time: A duration of 90 minutes is not the same as 1:90; it should be expressed as 1 hour and 30 minutes.

To double-check your result, add the interval back to the start time—you should get the end time.

Real-World Applications

Time difference calculations appear in many everyday situations:

  • Work scheduling: An employee who clocks in at 8:45 AM and out at 5:30 PM has worked 8 hours and 45 minutes (minus breaks).
  • Cooking: If a recipe says to bake for 35 minutes and you start at 4:20 PM, it will be done at 4:55 PM.
  • Travel: A flight departing at 10:15 AM and arriving at 1:40 PM (same time zone) takes 3 hours and 25 minutes.
  • Sports: A runner who starts a race at 9:00:00 AM and finishes at 9:37:42 AM has a time of 37 minutes and 42 seconds.

In each case, the same subtraction rules apply, but the context determines how you interpret the result.

Frequently Asked Questions

How do I calculate the time between two times in Excel?

In Excel, you can subtract the start time from the end time directly if both are in time format. For example, if A1 is the start time and B1 is the end time, the formula =B1-A1 will give the difference. If the result is negative (due to overnight), use =IF(B1<A1, B1+1-A1, B1-A1). Format the cell as a time duration.

What is the formula for time difference in hours?

To get the difference in hours as a decimal, subtract the start time from the end time and multiply by 24. For example, if the difference is 1.5 hours, that means 1 hour and 30 minutes. In Excel, use =(B1-A1)*24.

How do I calculate minutes between two times?

First, find the difference in hours and minutes, then convert to minutes. For example, 2 hours and 15 minutes is 2*60 + 15 = 135 minutes. You can also multiply the decimal hour difference by 60.

Does the time difference include the start time?

No, the interval is the elapsed time from the start moment to the end moment. If you start at 10:00 and end at 10:30, the duration is 30 minutes, not 31. The start time is the zero point.

How do I calculate time difference with seconds?

Convert both times to total seconds since midnight (hours*3600 + minutes*60 + seconds), subtract, and then convert back to hours, minutes, and seconds. For example, from 10:20:30 to 11:45:15 is 1 hour, 24 minutes, and 45 seconds.

What if the end time is before the start time?

If the end time is earlier on the clock (e.g., 2:00 AM vs. 11:00 PM), it means the interval crosses midnight. Add 24 hours to the end time before subtracting. This is the standard way to handle overnight durations.