Time calculators

Time Difference Calculator

Updated Nov 17, 2026 By Infinity Calculator Formulas Sources
Rate
Same-Day Time Difference
Start Time
Hour
:
Min
:
Sec
AM/PM
End Time
Hour
:
Min
:
Sec
AM/PM
Hours
8
Minutes
30
Seconds
0
The difference between 9:00:00 AM and 5:30:00 PM is 8 hours, 30 minutes, and 0 seconds.
Date & Time Difference
Start Date & Time
Date
Hour
:
Min
:
Sec
AM/PM
End Date & Time
Date
Hour
:
Min
:
Sec
AM/PM
Years
0
Months
0
Days
0
Hours
0
Minutes
0
Select dates and times, then click Calculate.
Also Expressed As
Total Days
0
Total Hours
0
Total Minutes
0
Total Seconds
0
Add or Subtract Time
Starting Date & Time
Date
Hour
:
Min
:
Sec
AM/PM
Operation & Duration
Set a starting date/time and duration, then click Calculate.
Time Breakdown Visualization

Introduction

The Time Difference Calculator helps you find the exact time between two points. You can calculate the difference between two times on the same day, find the gap between two dates and times, or add and subtract time from a starting date. Whether you need to track work hours, plan a trip, or figure out how long an event will last, this tool gives you quick and accurate results in hours, minutes, and seconds.

How to Use Our Time Difference Calculator

Enter your start and end times to find the exact difference in hours, minutes, and seconds. This calculator also lets you find differences between dates or add and subtract time from any date. Every section counts clock time and does not adjust for daylight saving time. Each spring clock change inside a span makes it last one hour less than the result shows, and each fall change makes it last one hour more, so a span that takes in one of each lasts exactly what the result shows.

Same-Day Time Difference

Start Time: Enter the hour, minute, and second for your start time, then pick AM or PM. Click "Now" to use the current time.

End Time: Enter the hour, minute, and second for your end time, then pick AM or PM. Click "Now" to use the current time.

Swap Button: Click the arrow button between the two times to switch the start and end times.

Calculate: Click "Calculate" to see the difference in hours, minutes, and seconds. If the end time is earlier than the start time, the tool treats it as crossing midnight.

Date and Time Difference

Start Date & Time: Pick a start date from the calendar, then enter the hour, minute, second, and AM or PM.

End Date & Time: Pick an end date from the calendar, then enter the hour, minute, second, and AM or PM.

Calculate: Click "Calculate" to see the difference broken down by years, months, days, hours, and minutes. You will also see totals in days, hours, minutes, and seconds.

Add or Subtract Time

Starting Date & Time: Pick a date and enter the hour, minute, second, and AM or PM as your starting point.

Operation: Choose "Add" to move forward in time or "Subtract" to move backward in time.

Duration: Enter the number of years, months, days, hours, and minutes you want to add or subtract.

Calculate: Click "Calculate" to see the new date and time after the duration is applied.

What Is a Time Difference Calculator?

A time difference calculator helps you find out how much time is between two points. You can use it to count the hours, minutes, and seconds from one time to another. This is useful when you need to track work hours, figure out how long a trip takes, or plan events. If you need to log daily work hours or manage employee schedules, knowing the time difference is the first step.

How Time Differences Work

Time is measured in hours, minutes, and seconds. One hour has 60 minutes, and one minute has 60 seconds.1 To find the difference between two times, you subtract the earlier time from the later time. If the end time is earlier than the start time and no date is given, the end time is counted as the next day, so the span crosses midnight.

Date and Time Together

When you include dates along with times, you can measure much longer spans. The difference can be shown in years, months, days, hours, and minutes. This is helpful for counting down to a birthday, finding out how long ago something happened with a date duration calculator, or calculating deadlines.

Adding and Subtracting Time

Sometimes you need to add or subtract time from a specific date. For example, if a package ships today and takes 5 days and 3 hours, you can add that time to find the delivery date. Or if a deadline was 2 weeks ago, you can subtract to find that past date.


Formulas used

Same-Day Time Difference
\Delta T = T_{\text{end}} - T_{\text{start}} \pmod{86400 \text{ seconds}}
Convert 12-hour to Total Seconds 1
T_{\text{sec}} = h_{24} \times 3600 + m \times 60 + s
Decompose Seconds to H:M:S 1
h = \left\lfloor \frac{\Delta T}{3600} \right\rfloor, \quad m = \left\lfloor \frac{\Delta T \bmod 3600}{60} \right\rfloor, \quad s = \Delta T \bmod 60
Total Days from Milliseconds 2
D_{\text{total}} = \frac{|T_{\text{end}} - T_{\text{start}}|}{86400000}
Total Hours / Minutes / Seconds
H_{\text{total}} = \left\lfloor \frac{\Delta_{\text{sec}}}{3600} \right\rfloor, \quad M_{\text{total}} = \left\lfloor \frac{\Delta_{\text{sec}}}{60} \right\rfloor, \quad S_{\text{total}} = \Delta_{\text{sec}}
Add/Subtract Time
T_{\text{result}} = T_{\text{start}} \pm (Y \text{ years} + M \text{ months} + D \text{ days} + h \text{ hours} + m \text{ minutes})

Frequently asked questions

How do I calculate overnight work hours?

Use the Same-Day Time Difference section. Enter your start time (like 10:00 PM) and end time (like 6:00 AM). The tool detects the midnight crossing and gives you a total of 8 hours. In most of the United States, daylight saving time begins at 2:00 AM on the second Sunday of March, when the clock skips ahead to 3:00 AM, and ends at 2:00 AM on the first Sunday of November, when the clock goes back to 1:00 AM.3 On those two nights, a 10:00 PM to 6:00 AM shift lasts 7 hours in March and 9 hours in November.


Sources

  1. SP 330 – Section 4: Non-SI units that are accepted for use with the SI. National Institute of Standards and Technology. Table 8. Accessed September 29, 2026.
  2. ECMAScript Language Specification (ECMA-262), 21 Numbers and Dates. Ecma International. § 21.4.1 Time Values and Time Range (MillisecondsPerDay). Accessed September 29, 2026.
  3. Daylight Saving Time Rules. National Institute of Standards and Technology. 2026;What are the current rules for daylight saving time?. Accessed November 17, 2026.