Elapsed Time Between Two Times Calculator

Elapsed Time Between Two Times Calculator

Leading AI Skill PRO

Enter Calculation

Formula

Δt=(E−S)mod86400secondswhere{S=3600Start h+60Start m+Start sE=3600End h+60End m+End s\begin{gathered} \Delta t = \left(E - S\right) \bmod 86400 \quad\text{seconds} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} S &= 3600\,\text{Start h} + 60\,\text{Start m} + \text{Start s} \\ E &= 3600\,\text{End h} + 60\,\text{End m} + \text{End s} \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

Elapsed time
7:10:00
hours : minutes : seconds
In hours 7.166667 h
In minutes 430 min
In seconds 25,800 s

Report an error on this page

What this calculator does

This tool computes the elapsed time between a start time and an end time, where each time is entered as an hour, minute, and second within a day. It returns the duration in a familiar H:MM:SS format and also expressed as a decimal total in hours, in minutes, and as a whole number of seconds. The math is pure clock arithmetic and works the same everywhere, regardless of region or time zone.

Timeline showing start and end markers with shaded elapsed duration between them
Elapsed time is the shaded span from the start time to the end time.

How to use it

Enter the start time (hour, minute, second) and the end time (hour, minute, second). Use a 24-hour clock so that, for example, 3:40 PM is entered as hour 15. Press calculate. If the end time falls earlier than the start time, the calculator assumes the end time is on the next day and adds 24 hours automatically — perfect for overnight shifts or sleep that crosses midnight.

The formula explained

Each time is converted to total seconds of the day: hour times 3600 plus minute times 60 plus seconds. The difference is endTotal minus startTotal. When that difference is negative, the calculator adds 86400 (the number of seconds in one day) so the result wraps to the next day. From the resulting total seconds, hours are the floor of seconds divided by 3600, minutes are the floor of the remainder divided by 60, and seconds are the remainder modulo 60.

$$\begin{gathered} \Delta t = \left(E - S\right) \bmod 86400 \quad\text{seconds} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} S &= 3600\,\text{Start h} + 60\,\text{Start m} + \text{Start s} \\ E &= 3600\,\text{End h} + 60\,\text{End m} + \text{End s} \end{aligned} \right. \end{gathered}$$
Advertisement
Circular 24-hour dial with arrow sweeping past midnight from evening start to morning end
When the end time is earlier than the start, the duration rolls over past midnight.

Worked example

Start = 08:30:00 gives 30,600 seconds. End = 15:40:00 gives 56,400 seconds. The difference is 25,800 seconds, which is 7 hours, 10 minutes, 0 seconds — shown as 7:10:00. As totals that is 7.166667 hours, 430 minutes, or 25,800 seconds.

$$\Delta t = (56{,}400 - 30{,}600) \bmod 86400 = 25{,}800 \text{ s} = 7{:}10{:}00$$

Elapsed Time Across Common Scenarios

The six cases below show how the same formula \(\Delta t = (E - S) \bmod 86400\) handles ordinary daytime spans, overnight shifts, zero-length spans and the extreme near-24-hour case. "Rollover applied?" means the end time was earlier than or equal to the start time, so the calculator assumed the end time falls on the next day and added 86,400 s.

Start End Rollover applied? H:MM:SS Decimal hours Total minutes Total seconds
09:00:00 17:30:00 No 8:30:00 8.5 h 510 min 30,600 s
22:00:00 06:30:00 Yes 8:30:00 8.5 h 510 min 30,600 s
23:45:00 00:15:00 Yes 0:30:00 0.5 h 30 min 1,800 s
07:15:30 07:15:30 No 0:00:00 0 h 0 min 0 s
12:00:00 11:59:59 Yes 23:59:59 23.999722 h 1,439.983 min 86,399 s
06:05:10 14:50:45 No 8:45:35 8.759722 h 525.583 min 31,535 s

Two pairs of rows are worth comparing. The 09:00→17:30 day shift and the 22:00→06:30 night shift produce an identical 8 h 30 min: the rollover changes the arithmetic, not the duration. And 07:15:30→07:15:30 returns exactly zero, while 12:00:00→11:59:59 returns the largest value the tool can produce.

That maximum is 23:59:59 (86,399 s). Because only a single rollover is ever applied, the result is always in the range \(0 \le \Delta t \le 86399\) seconds — strictly less than one full day. Identical start and end times are therefore read as zero elapsed time, not as a full 24-hour span. If you genuinely need a duration of 24 hours or more, you must track calendar dates as well as clock times, which is outside what a two-time clock calculation can express.

Working the last row by hand confirms the method:

$$S = 3600(6) + 60(5) + 10 = 21{,}910\ \text{s}$$$$E = 3600(14) + 60(50) + 45 = 53{,}445\ \text{s}$$$$\Delta t = (53{,}445 - 21{,}910) \bmod 86{,}400 = 31{,}535\ \text{s}$$

Splitting 31,535 s gives \(31{,}535 \div 3600 = 8\) hours with 2,735 s left, then \(2{,}735 \div 60 = 45\) minutes with 35 s left — that is 8:45:35, or \(31{,}535 / 3600 = 8.759722\) decimal hours.

Advertisement

Key Terms and Variables

  • Elapsed time (duration) — the length of the interval between two instants, answering "how long?" rather than "when?". It is a quantity with a unit (seconds, minutes, hours), not a point on the clock.
  • Start time, \(S\) — the beginning instant, converted to seconds-of-day: \(S = 3600 h + 60 m + s\). For 09:30:15, \(S = 34{,}215\) s.
  • End time, \(E\) — the ending instant, converted the same way: \(E = 3600 h + 60 m + s\).
  • \(\Delta t\) (delta t) — the computed elapsed time in seconds, \(\Delta t = (E - S) \bmod 86400\). The Greek capital delta conventionally means "change in" or "difference in", so \(\Delta t\) reads as "change in time".
  • Seconds of day — a single integer locating a clock time within a day, from 0 (00:00:00, midnight) to 86,399 (23:59:59). Expressing both times this way reduces the problem to one subtraction instead of borrowing across hours, minutes and seconds.
  • Modulo (mod 86400) — the remainder after division by 86,400 (the number of seconds in a day). It wraps negative differences back into the valid range: if \(E - S = -5{,}400\), then \(-5{,}400 \bmod 86{,}400 = 81{,}000\) s = 22:30:00. Mathematical modulo always returns a non-negative remainder here, which is exactly the behaviour overnight spans need.
  • Midnight rollover (next-day assumption) — when \(E \le S\), the end time is taken to be on the following day, which is what the mod operation accomplishes. This is why 22:00 → 06:30 gives 8 h 30 min rather than a negative result. The assumption is a convention: the calculator cannot know whether you meant the same day, so it always picks the next occurrence of the end time.
  • 24-hour clock — hours run 0–23, so no AM/PM marker is needed. This calculator uses it. Conversions from the 12-hour clock: 00:00 is 12 AM (midnight), 12:00 is 12 PM (noon), 15:00 is 3 PM, 21:45 is 9:45 PM. The common mistakes are entering 12 for midnight (should be 0) and entering 0 for noon (should be 12).
  • Decimal hours vs H:MM:SS — the same duration in two notations. H:MM:SS (8:45:35) is sexagesimal and suits schedules and logs; decimal hours (8.759722) are base-10 and suit multiplication by a rate, summing in a spreadsheet, or payroll entry. 8:30 is not 8.30 hours — it is 8.5 hours.
  • Floor division and remainder — the two operations that split \(\Delta t\) into H:MM:SS. Floor division \(\lfloor \Delta t / 3600 \rfloor\) discards the fractional part to give whole hours; the remainder \(\Delta t \bmod 3600\) is then split the same way by 60 to give minutes and leftover seconds.

Why time zones and DST do not appear above. This calculation is pure clock arithmetic on the six numbers you enter — it never consults a calendar date, a time-zone database or a daylight-saving rule. 09:00 to 17:30 is 8 h 30 min whether those readings came from a clock in Tokyo, Berlin or Chicago, so the result is time-zone independent and DST independent by construction.

The flip side is that the result reflects clock time, not necessarily physical duration. On a day when local clocks shift (spring-forward and fall-back dates differ by country and are not observed everywhere), a shift recorded as 22:00 to 06:00 may have lasted 7 or 9 real hours even though this calculator reports 8:00:00. Likewise a leap second, when one is inserted, is not represented. For such cases — and for any span of 24 hours or more — use a calculation that includes full dates and a time zone.

FAQ

What if the end time is before the start time? The end time is treated as the next day, so a full 24 hours (86400 seconds) is added to the difference. For example 22:00 to 06:30 yields 8:30:00.

What if start equals end? The elapsed time is 0:00:00. Only strictly negative differences roll over to the next day.

What can I use it for? Common uses include measuring sleep duration, work or overtime hours, shift length, waiting time, and timers that cross midnight.

Last updated:

Most popular in Time and Date

View all Time and Date calculators