Saved calculators
Everyday Life

Time span calculator

Reset
Share
Save
Embed
Report a bug

Share calculator

Add our free calculator to your website

Please enter a valid URL. Only HTTPS URLs are supported.

Use as default values for the embed calculator what is currently in input fields of the calculator on the page.
Input border focus color, switchbox checked color, select item hover color etc.

Please agree to the Terms of Use.
Preview

Save calculator

Share calculator

What is a time span calculator?

A time span calculator is a simple yet powerful tool that helps determine the difference between two given points in time. Whether you need to calculate how many hours and minutes you worked in a day, measure how long it took to complete a task, or find out how much time remains until a certain event, this calculator provides instant results.

The calculator operates in 24-hour time format and automatically computes the exact duration between two given moments of time. It is also capable of handling calculations that go over midnight—something that is particularly useful for shift workers, transportation schedules, and time-based event planning.

How the calculator works

The time span calculator functions by subtracting one time value from another. Depending on the order of times entered and whether the period crosses midnight, the result can be positive or negative, or it can extend beyond a 24-hour period.

For example:

  • From 10:00 to 20:00, the result is 10 hours.
  • From 20:00 to 10:00 (the next morning), the result is 14 hours, since the time difference spans beyond midnight.

The calculator automatically adjusts for these cases and can show multiple versions of the result: the direct interval and the interval “over midnight.”

Formula

To calculate the difference between two times, use the following general formula:

Time Span=Second TimeFirst Time\text{Time Span} = \text{Second Time} - \text{First Time}

However, since time wraps around after 24 hours, we have two main cases:

Case 1: When second time is later than first time (same day)

Difference=(T2T1)\text{Difference} = (T_2 - T_1)

Case 2: When second time is earlier than first time (over midnight)

Difference=(24 hoursT1)+T2\text{Difference} = (24\text{ hours} - T_1) + T_2

Here:

  • T1T_1 = first time (in decimal hours or “hh:mm:ss” format)
  • T2T_2 = second time (in the same format)
  • The result is the total time interval between the two times.

Examples

Example 1: Calculating time difference within the same day

Let the first time be 08:30, and the second time be 14:45.

T1=8h30m=8.5hT_1 = 8h \, 30m = 8.5h T2=14h45m=14.75hT_2 = 14h \, 45m = 14.75h Difference=14.758.5=6.25h=6h15m\text{Difference} = 14.75 - 8.5 = 6.25h = 6h\,15m

Thus, the time span between 08:30 and 14:45 is 6 hours and 15 minutes.

Example 2: Time difference across midnight

Let the first time be 21:15, and the second time be 04:30.

T1=21.25h,T2=4.5hT_1 = 21.25h,\quad T_2 = 4.5h

Since the second time is smaller than the first, it means the time crosses midnight:

Difference=(2421.25)+4.5=2.75+4.5=7.25h=7h15m\text{Difference} = (24 - 21.25) + 4.5 = 2.75 + 4.5 = 7.25h = 7h\,15m

Hence, the time span from 21:15 to 04:30 is 7 hours and 15 minutes.

Example 3: Using 12-hour format

If someone starts a task at 11:00 PM and finishes it at 3:30 AM, the time difference is again 4 hours and 30 minutes, since the time passes through midnight. The calculation remains the same, only the notation changes.

FAQs

How to calculate the duration from 10:00 to 20:00?

Using the formula T2T1=2010=10T_2 - T_1 = 20 - 10 = 10, the time span is 10 hours.

How many hours are there between 22:00 and 04:00?

Since the time passes midnight:

Difference=(2422)+4=2+4=6\text{Difference} = (24 - 22) + 4 = 2 + 4 = 6

The time difference is 6 hours.

How to convert 12-hour time to 24-hour time to use it properly?

Add 12 hours to the PM values (except for 12 PM) and leave AM values unchanged (except 12 AM, which becomes 00:00). For example: 3:00 PM → 15:00; 12:00 AM → 00:00.

Report a bug