Fast & Deterministic

Free Time Duration Calculator

Calculate exact hours, minutes, seconds, and decimal time between two timestamps instantly.

Add or subtract time
⚡ Presets:
START
:
09:00 AM (Civilian)
END
:
05:00 PM (17:00 Military)
☕ Deduct Unpaid Break: mins
DURATION
8h 0m 0s
8.00 Total hours
480 Total minutes
28,800 Total seconds
TOPICAL SUITE

Time & Duration Calculators

Core tools for calculating elapsed time, adding time, and subtracting intervals.

TOPICAL SUITE

Work & Payroll Timesheet Tools

Daily shift trackers, 4-punch time cards, and 7-day weekly overtime calculators.

TOPICAL SUITE

Decimal & Unit Converters

Convert clock minutes to decimal hours, military time, and universal time units.

Step-by-Step Guide

How to Use This Calculator

STEP 1
01 / 04

Enter Start Time

Input the beginning hour and minute. Toggle AM/PM in 12-hour civilian mode or type military hours in 24-hour mode.

STEP 2
02 / 04

Enter End Time

Input the ending hour and minute. If the end time is numerically earlier, overnight shift detection is automatically applied.

STEP 3
03 / 04

Deduct Breaks (Optional)

Select a quick break pill (e.g. 30m Lunch) or type custom unpaid minutes to calculate net billable hours.

STEP 4
04 / 04

Copy & Export Results

Instant conversion into decimal hours for payroll, total minutes, total seconds, and one-click copy to clipboard.

Mathematical Proofs

Mathematical Formulas & Rules

Modulo 24-Hour Duration Formula

Duration (Hours) = (T_end - T_start + 24) mod 24
Variable Definitions:
  • T_start = Starting timestamp in decimal hours from midnight (0.0 to 24.0)
  • T_end = Ending timestamp in decimal hours from midnight (0.0 to 24.0)
  • mod 24 = Modulo 24 arithmetic ensuring continuous cross-midnight calculation

Eliminates negative duration errors when shifts span past 12:00 AM midnight.

Decimal Hours Conversion Formula

Decimal Hours = Hours + (Minutes / 60) + (Seconds / 3600)
Variable Definitions:
  • Hours = Integer hour component
  • Minutes = Remaining minutes (0 to 59)
  • Seconds = Remaining seconds (0 to 59)

Standard conversion formula required for payroll processing systems (ADP, QuickBooks, Gusto).

Practical Applications

Worked Calculation Examples

Step-by-step breakdown of common real-world time scenarios, work shifts, and duration math.

Example 1 Verified Math

Standard 9-to-5 Shift with 30-Min Lunch

Scenario

An employee clocks in at 8:30 AM and clocks out at 5:00 PM with a 30-minute unpaid lunch break.

Calculation: (17:00 - 08:30) - 30 mins = 8 hrs 30 mins - 30 mins
Result: 8 Hours 0 Minutes (8.00 Decimal Hours)
Example 2 Verified Math

Overnight Graveyard / Night Shift

Scenario

A healthcare worker starts their shift at 9:45 PM and finishes at 6:15 AM the following morning.

Calculation: (06:15 + 24:00) - 21:45 = 30:15 - 21:45
Result: 8 Hours 30 Minutes (8.50 Decimal Hours)
Example 3 Verified Math

Afternoon Flight or Study Session

Scenario

A student begins a study block at 1:15 PM and concludes at 4:50 PM.

Calculation: 16:50 - 13:15 = 3 hrs 35 mins
Result: 3 Hours 35 Minutes (3.5833 Decimal Hours)
Example 4 Verified Math

Athletic Race / Marathon Split

Scenario

A runner starts a half-marathon at 7:00:00 AM and crosses the finish line at 8:44:22 AM.

Calculation: 08:44:22 - 07:00:00
Result: 1 Hour 44 Minutes 22 Seconds

Understanding Time Duration Calculations

Calculating the duration between two times is a fundamental mathematical operation used daily across global industries, from payroll processing and project management to aviation block times and sports athletic timing. While calculating the difference between two timestamps on the same clock cycle appears straightforward, nuances such as base-60 sexagesimal arithmetic, midnight crossover boundaries, and decimal conversions for payroll require structured mathematical rules.

1. Base-60 (Sexagesimal) Arithmetic vs. Base-10 (Decimal)

Standard clock time operates on a sexagesimal (base-60) numerical system inherited from ancient Babylonian astronomy, where 1 hour comprises 60 minutes, and 1 minute comprises 60 seconds. Conversely, modern accounting, enterprise software, and payroll spreadsheets operate on a base-10 (decimal) system. Learn more in our comprehensive Time & Payroll Guides or test your calculation on our flagship Time Duration Calculator.

When subtracting time (such as 5:15 PM - 8:30 AM), one cannot simply perform base-10 decimal subtraction. If the minute value of the ending timestamp is smaller than the minute value of the starting timestamp (e.g. 15 minutes minus 30 minutes), one must borrow 1 whole hour, which converts into 60 minutes rather than 100 units.

2. Handling Overnight & Past-Midnight Spans

Graveyard shifts, night flights, and late-night study sessions frequently cross midnight. In a 24-hour format, a shift starting at 22:00 (10:00 PM) and ending at 06:00 (6:00 AM) yields a naive subtraction of 6 - 22 = -16.

To resolve negative spans across calendar days deterministically, modulo arithmetic is applied: (6 - 22 + 24) = 8 hours. For quick preset shifts, check our Time Between Two Times Calculator or compute total elapsed shift hours with break deduction on the Hours Calculator.

3. Converting Duration to Decimal Hours for Payroll

In payroll processing, employee wages are computed by multiplying total billable hours by an hourly pay rate (e.g. $25.00/hr). Multiplying hours and minutes directly without decimal conversion produces severe mathematical errors (for example, multiplying $20.00 × 7.30 instead of $20.00 × 7.50 would underpay an employee by $4.00 per shift).

Easily convert your shift duration to payroll decimals with our Decimal Hours Calculator and Minutes to Decimal Chart, or calculate gross earnings automatically using our Work Hours Calculator.

  • 15 minutes: 15 / 60 = 0.25 hours
  • 30 minutes: 30 / 60 = 0.50 hours
  • 45 minutes: 45 / 60 = 0.75 hours
  • General Formula: Decimal Hours = Total Minutes / 60

Frequently Asked Questions

How do you calculate the duration between two times?

To calculate the duration between two times, convert both times to a 24-hour military format, subtract the starting hours and minutes from the ending hours and minutes, and borrow 60 minutes from the hours column if the ending minutes are smaller than the starting minutes.

How do you calculate time across midnight (overnight)?

When the ending time is on the next calendar day (numerically smaller than the start time), add 24 hours (or 1,440 minutes) to the ending time before subtracting the starting time.

How do I convert the time duration to decimal hours for payroll?

To convert duration to decimal hours, keep the integer hours and divide the remaining minutes by 60. For example, 7 hours and 45 minutes equals 7 + (45 / 60) = 7.75 decimal hours.

Can I deduct an unpaid lunch break from the total duration?

Yes. Enter your break duration in minutes into the "Deduct Break" field. The calculator automatically subtracts the break from the gross elapsed duration to show your net billable time.

Mathematical Accuracy & Editorial Review

All calculations on this tool are deterministic and rigorously tested against base-60 modulo arithmetic and US Fair Labor Standards Act (FLSA 29 CFR § 785.48) payroll rounding guidelines.

Reviewed by: Time Mathematics & Payroll Editorial Team Last Updated: April 2026