Calculators & Math • Published March 28, 2025 • 8 min read

How to Calculate Hours Between Two Times Accurately: 12-Hour AM/PM and 24-Hour Systems

Master calculating the hours between two times. Complete guide covering AM/PM conversions, military time subtraction, borrowing 60 minutes, and midnight crossovers.

Step-by-step tutorial on calculating exact hours and minutes between two times. Master borrowing sexagesimal minutes, military 24-hour subtraction, and mental math shortcuts.
Wall clock displaying 12-hour time and elapsed duration
Calculating hours between two clock times requires systematic conversion from 12-hour AM/PM to continuous 24-hour military time.

Why Calculating Hours Between Two Times Is Harder Than It Looks

At first glance, calculating the number of hours between two times appears simple. If a meeting starts at 2:00 PM and ends at 5:00 PM, you subtract 2 from 5 to get 3 hours. However, real-world schedules rarely fall on clean, top-of-the-hour boundaries. Shift times such as 7:38 AM to 4:19 PM or overnight work blocks like 9:45 PM to 6:15 AM introduce complex borrowing and base-60 conversions that frequently lead to errors on payroll spreadsheets and timecards.

In this guide, you will learn the exact mathematical rules for calculating hours between two times in both 12-hour AM/PM and 24-hour military time formats, complete with mental math tricks and formal columnar subtraction algorithms.


Method 1: The "Bridge to the Nearest Hour" Mental Math Technique

For quick day-to-day calculations without pencil and paper, the Bridge Technique is the fastest and most reliable mental strategy.

The 3-Step Bridge Process:

  1. Bridge to the Next Whole Hour: Calculate how many minutes are needed to reach the next round hour from your start time ($60 - \text{Start Minutes}$).
  2. Count Full Hours: Count the integer hours from that round hour up to the hour of the end time.
  3. Add the End Minutes: Add the minutes of the destination timestamp.

Example Walkthrough:

Calculate elapsed time from 8:40 AM to 1:15 PM.

Step 1 (Bridge Start): 8:40 AM  --> 9:00 AM  = 20 minutes
Step 2 (Full Hours):   9:00 AM  --> 1:00 PM  = 4 hours
Step 3 (Bridge End):   1:00 PM  --> 1:15 PM  = 15 minutes

Sum: 4 hours + (20 min + 15 min) = 4 hours and 35 minutes.

This mental strategy completely avoids negative numbers and complex borrowing rules.


Method 2: Formal Columnar Subtraction with Sexagesimal Borrowing

When building automated workflows or verifying printed timesheets, formal columnar subtraction is the standard approach.

The Sexagesimal Borrowing Rule:

When subtracting minutes ($M_2 - M_1$), if $M_2 < M_1$, you must borrow 1 Hour from $H_2$. Because $1 \text{ Hour} = 60 \text{ Minutes}$, add $60$ to $M_2$ and decrement $H_2$ by $1$:

$\begin{array}{rcc}

& 14 \text{ hrs} & 15 \text{ min} \\

  • & 08 \text{ hrs} & 45 \text{ min} \\

\hline

\end{array}

\quad \longrightarrow \quad

\begin{array}{rcc}

& 13 \text{ hrs} & (15 + 60) = 75 \text{ min} \\

  • & 08 \text{ hrs} & 45 \text{ min} \\

\hline

& \mathbf{05 \text{ hrs}} & \mathbf{30 \text{ min}}

\end{array}$

Step-by-Step Breakdown:

  1. Convert 2:15 PM to 24-hour military time $\rightarrow$ 14:15.
  2. Start time is 8:45 AM $\rightarrow$ 08:45.
  3. We cannot subtract 45 minutes from 15 minutes directly without a negative result.
  4. Borrow 1 hour from 14 (leaving 13 hours) and add 60 minutes to 15 (yielding 75 minutes).
  5. Subtract minutes: $75 - 45 = 30$ minutes.
  6. Subtract hours: $13 - 8 = 5$ hours.
  7. Final Result: 5 hours and 30 minutes (5.50 decimal hours).

Handling the Midnight Rollover (Overnight Shifts)

When calculating hours between two times where the start time occurs in the evening and the end time occurs the next morning, the end time's military hour is numerically smaller than the start time.

Example: Calculate the duration from 10:30 PM (22:30) to 6:15 AM (06:15).

To resolve this, add 24 hours to the end time to account for the full 1-day cycle:

$\text{Adjusted End Time} = 06:15 + 24:00 = 30:15$

Now perform standard columnar subtraction:

$\begin{array}{rcc}

& 30 \text{ hrs} & 15 \text{ min} \\

  • & 22 \text{ hrs} & 30 \text{ min} \\

\hline

\end{array}

\quad \longrightarrow \quad

\begin{array}{rcc}

& 29 \text{ hrs} & 75 \text{ min} \\

  • & 22 \text{ hrs} & 30 \text{ min} \\

\hline

& \mathbf{07 \text{ hrs}} & \mathbf{45 \text{ min}}

\end{array}$

The total elapsed duration is 7 hours and 45 minutes (7.75 decimal hours).


The Decimal Time Conversion Principle for Payroll

Once you have calculated the exact hours and minutes between two times, converting to decimal hours is essential for payroll, billing, and accounting software. Time is base-60, but money is base-10.

$\text{Decimal Hours} = \text{Hours} + \left(\frac{\text{Minutes}}{60}\right)$

Key Decimal Equivalents:

  • 15 Minutes: $15 / 60 = 0.25$ hours
  • 30 Minutes: $30 / 60 = 0.50$ hours
  • 45 Minutes: $45 / 60 = 0.75$ hours
  • 6 Minutes: $6 / 60 = 0.10$ hours (frequently used in legal and consulting billing)
  • 12 Minutes: $12 / 60 = 0.20$ hours

Summary Reference Table

| Start Time | End Time | Conversion Method | Elapsed Duration | Decimal Hours |

| :--- | :--- | :--- | :--- | :--- |

| 08:00 AM | 05:00 PM (17:00) | $17:00 - 08:00$ | 9 hrs 00 min | 9.00 hrs |

| 09:15 AM | 02:45 PM (14:45) | $14:45 - 09:15$ | 5 hrs 30 min | 5.50 hrs |

| 07:45 AM | 04:15 PM (16:15) | $15:75 - 07:45$ | 8 hrs 30 min | 8.50 hrs |

| 11:30 PM (23:30)| 07:00 AM (+1 Day)| $31:00 - 23:30$ | 7 hrs 30 min | 7.50 hrs |

| 06:50 PM (18:50)| 02:10 AM (+1 Day)| $26:10 - 18:50$ | 7 hrs 20 min | 7.33 hrs |

Use our automated Time Duration Calculator to compute complex multi-shift durations with lunch break deductions in milliseconds.

Hand calculating hours worked on a timesheet document
Manual timesheet calculations often suffer from arithmetic borrowing errors when minutes exceed 60.

Frequently Asked Questions

Q1. How do you calculate hours between two times manually?

First, find the minutes needed to reach the next full hour from the start time. Next, count the whole hours between that next hour and the target hour. Finally, add the remaining minutes of the end time. For example, from 8:40 AM to 11:15 AM: 20 min to 9:00 AM + 2 hours to 11:00 AM + 15 min to 11:15 AM = 2 hours and 35 minutes.

Q2. What is the rule for borrowing minutes in time subtraction?

In standard arithmetic, borrowing from the tens column adds 10. In time subtraction, borrowing 1 from the Hours column adds 60 to the Minutes column. For example, 14:15 minus 08:45 becomes 13:75 minus 08:45 = 05:30 (5 hours and 30 minutes).

Q3. How do you calculate hours between AM and PM?

Convert PM times to 24-hour format by adding 12 hours (except 12:00 PM noon). For example, 3:30 PM becomes 15:30. Then subtract the AM start time (e.g., 8:15 AM): 15:30 - 08:15 = 7 hours and 15 minutes.

Calculate Hours Between Any Two Times

Quickly find the exact hours and minutes between two timestamps with our free browser utility.

Try Time Calculator
DevToolAdda
✨ Next-Gen Developer Workspace 2.0

Everything Developers Need, 100+ Free Developer Tools.

DevToolAdda provides 100+ free online developer tools, formatters, decoders, generators, validators, and cheatsheets. 100% private, client-side, and instant.