Time Duration Between Two Clock Times
Subtracts a start clock time from an end clock time to return the elapsed duration in hours and minutes, with optional handling for shifts that cross midnight.
duration = endTime − startTime
How It Works
The calculator converts each HH:MM clock time into total minutes from midnight, subtracts the start minutes from the end minutes, and converts the difference back into a clean hours-and-minutes breakdown. If the end time falls before the start time and the “crosses midnight” box is checked, 24 hours are added to the end time so the duration measures the overnight span correctly. Decimal hours, total minutes, and total seconds are all derived from the same subtraction so every output is internally consistent.
Example Problem
How many hours and minutes elapse between a 09:15 start time and a 17:45 end time on the same day?
- Identify the start and end clock times: start = 09:15, end = 17:45.
- Convert each time to total minutes from midnight: start = 9 × 60 + 15 = 555 min, end = 17 × 60 + 45 = 1065 min.
- Subtract to get the elapsed duration in minutes: 1065 − 555 = 510 minutes.
- Convert minutes back to hours and minutes: 510 ÷ 60 = 8 remainder 30, so the result is 8 hours and 30 minutes.
- Express the result in decimal hours for billing or payroll: 510 ÷ 60 = 8.5 hours.
- Express the result in total seconds for fine-grained timing: 510 × 60 = 30,600 seconds.
This is the canonical worked example for an 8.5-hour workday with a 30-minute unpaid lunch already removed.
Key Concepts
Clock arithmetic differs from regular arithmetic because the day wraps at midnight. The 24-hour notation makes the subtraction straightforward: a time like 17:45 is just 1065 minutes from midnight, and the elapsed duration between two times is the difference between their minute counts. When the end time is earlier than the start time, the calculator can treat the end time as the next day (adding 1440 minutes) so an overnight shift returns a positive duration. Decimal hours (510 min ÷ 60 = 8.5 h) are the standard format for payroll, billing, and timesheets.
Applications
- Work hours: track the elapsed time between clock-in and clock-out for an hourly job
- Billable hours: convert a meeting block into decimal hours for invoicing clients
- Travel time: estimate the duration of a flight, train ride, or road trip in hours and minutes
- Sleep duration: measure the span between bedtime and wake-up time, including overnight
- Cooking and baking: time how long an oven, smoker, or slow cooker has been running
- Meetings and class periods: confirm the length of a scheduled session in minutes
Common Mistakes
- Forgetting to check the “crosses midnight” box for overnight shifts — leaving it off returns an error instead of a duration
- Mixing 12-hour AM/PM notation with 24-hour notation — convert 5:45 PM to 17:45 before entering it
- Treating 24:00 as a different time from the next day's 00:00 — they are the same moment, just two ways to write it
- Entering minutes greater than 59 (for example 09:60) — minutes must be in the 00–59 range
- Subtracting in decimal form by hand: 17.75 − 9.25 = 8.5, which works numerically but only because both times happened to be on a quarter-hour boundary
Frequently Asked Questions
How do you calculate time duration?
Convert each clock time to total minutes from midnight, subtract the start from the end, then convert the difference back into hours and minutes. For 09:15 to 17:45 that is 1065 − 555 = 510 minutes, which is 8 hours and 30 minutes or 8.5 decimal hours.
How many hours are between two times?
Subtract the start time from the end time and convert the result to hours. If the end time is later in the same day, the duration is positive directly; if the end time is the next day, add 24 hours to the end before subtracting so the answer comes out positive.
How do I calculate hours worked?
Enter the clock-in time as the start and the clock-out time as the end. The calculator returns the elapsed duration in hours and minutes plus decimal hours, which is the standard format for payroll. Subtract any unpaid breaks manually before recording the total.
How do you handle times that cross midnight?
Check the “End time is the next day (crosses midnight)” box. The calculator then adds 24 hours to the end time before subtracting, so an overnight shift from 22:00 to 06:00 returns 8 hours rather than a negative value.
How do I convert HH:MM to decimal hours?
Divide the total elapsed minutes by 60. For example, 8 hours and 30 minutes equals 8 × 60 + 30 = 510 minutes, and 510 ÷ 60 = 8.5 decimal hours. The calculator shows the decimal-hour value alongside the HH:MM breakdown for billing and payroll.
What is the formula for time difference?
duration = endTime − startTime, measured in minutes. If the end time falls before the start time on the same day and the duration is intended to span midnight, add 24 hours (1440 minutes) to the end time before subtracting.
Can I use 12-hour AM/PM times in this calculator?
Convert AM/PM times to 24-hour notation before entering them. For example, 9:15 AM stays as 09:15 and 5:45 PM becomes 17:45. The native browser time picker on most devices accepts either notation and stores the value as 24-hour HH:MM.
Is 24:00 the same as 00:00?
Yes — they refer to the same instant. The calculator accepts 24:00 as an end-of-day marker so that an input of 00:00 to 24:00 returns a full 1440-minute (24-hour) day. The next day's clock starts at 00:00.
Reference: Durations are reported in whole minutes. Seconds are derived by multiplying minutes by 60 and are exact whenever the inputs are HH:MM.
Time Duration Formula
The calculator subtracts the start clock time from the end clock time after converting both to minutes-from-midnight:
Where:
- startTime — the earlier clock time, written in 24-hour HH:MM notation (for example 09:15)
- endTime — the later clock time, in the same 24-hour HH:MM notation (for example 17:45)
- duration — the elapsed time between the two clock times, shown in hours and minutes, decimal hours, total minutes, and total seconds
For overnight spans where the end time falls before the start time on the clock, check the “crosses midnight” box. The calculator then adds 24 hours (1440 minutes) to the end time before subtracting so the answer remains positive.
Worked Examples
Work Hours
How many hours are in a 09:15 to 17:45 workday with no break?
A salaried employee clocks in at 09:15 and out at 17:45 on the same calendar day. Payroll needs the elapsed shift length in both HH:MM and decimal-hour form.
- Start time = 09:15, end time = 17:45.
- Convert to minutes: 09:15 = 555 min, 17:45 = 1065 min.
- Elapsed minutes = 1065 − 555 = 510 minutes.
- Hours and minutes = 8 h 30 min.
- Decimal hours = 510 ÷ 60 = 8.5 h.
the shift is 8 hours and 30 minutes long, or 8.5 decimal hours for payroll.
This is the calculator's default example because it covers the most common scenario — a typical workday with no overnight wrap.
Overnight Shift
How many hours are between 22:00 and 06:00 the next morning?
A night-shift worker clocks in at 22:00 and out at 06:00 the following day. The end time is earlier than the start time on the clock, so the calculator needs to know the span crosses midnight.
- Start time = 22:00, end time = 06:00 (next day).
- Convert to minutes: 22:00 = 1320 min, 06:00 = 360 min.
- Because the end is earlier on the clock, add 24 h to the end: 360 + 1440 = 1800 min.
- Elapsed minutes = 1800 − 1320 = 480 minutes.
- Hours and minutes = 8 h 00 min (8.0 decimal hours).
the overnight shift is exactly 8 hours.
Always check the "crosses midnight" box for overnight spans; otherwise the calculator returns an error because the raw subtraction is negative.
Billable Meeting
How do you convert a 30-minute consult into decimal hours for billing?
A consultant runs a meeting from 14:00 to 14:30 and needs to record the time in decimal hours for an invoice.
- Start time = 14:00, end time = 14:30.
- Elapsed minutes = 30.
- Hours and minutes = 0 h 30 min.
- Decimal hours = 30 ÷ 60 = 0.5 h.
the consult is 0.5 decimal hours, the standard format for time tracking and invoicing software.
Related Calculators
- Days Between Dates Calculator — count the calendar days between two dates with three counting methods
- Overtime Pay Rate Calculator — calculate overtime earnings based on hours worked
- Karvonen Heart Rate Calculator — find target heart-rate zones from age and resting HR
- Hourly Salary Calculator — convert hourly wage to annual salary
Related Sites
- Dollars Per Hour — Weekly paycheck calculator with overtime
- Hourly Salaries — Hourly wage to annual salary converter
- BOGO Discount — Buy-one-get-one discount calculator
- Percent Off Calculator — Discount and sale price calculator
- Medical Equations — Hemodynamic, pulmonary, and dosing calculators
- Percent Error Calculator — Calculate percent error between experimental and theoretical values