Time Duration Calculator: Find the Span Between Two Times

Time duration calculator for hours between two times, overnight shifts, break deduction, and punch rounding. Get a decimal hours total for payroll or billing.

01 calculator
Clock

Result

    Show the working

      The Time Duration Calculator finds the exact span between a start time and an end time, in hours and minutes, then converts that span into decimal hours for payroll or billing. Enter a starting clock time and an ending clock time, subtract any unpaid break, and the calculator handles a shift that crosses midnight without needing a separate mode or manual adjustment.

      Time duration between two clock times answers "how long was this," a different question from adding several separate durations together. This page focuses on that single span calculation, with the rounding and break-deduction options that turn a raw punch pair into a payroll-ready figure. A time to time calculator and a time calculator duration label point at the same start-to-end math.

      Calculate time between two times

      Time between two times is the end clock minus the start clock, expressed in hours and minutes. The Time Duration Calculator accepts times in 12-hour format with AM or PM, or in 24-hour format, and returns the span alongside the same result in decimal hours, total minutes, and total seconds.

      Worked example: a shift from 8:30 AM to 5:30 PM, with a 30-minute unpaid break.

      1. Convert both times to minutes since midnight. 8:30 AM = 510 minutes. 5:30 PM = 1,050 minutes.

      2. Subtract to find the raw span. 1,050 − 510 = 540 minutes.

      3. Subtract the break. 540 − 30 = 510 minutes net.

      4. Format back to hours and minutes. 510 ÷ 60 = 8 remainder 30, so 8 hours 30 minutes.

      5. Convert to decimal. 30 ÷ 60 = 0.5, so the total is 8.5 decimal hours.

      Hours between two times

      Hours between two times uses that same minute subtraction, then converts back to hours and minutes or to decimal hours. An hours between times calculator is this page when the question is a single start and end pair rather than a list of separate durations.

      Calculate a shift that crosses midnight

      Concept diagram: Inputs leads to a shift that crosses midnight leads to ResultInputsa shift that crossesmidnightResult
      Calculate a shift that crosses midnight.

      When the end time is numerically smaller than the start time, the shift has crossed into the following day. The Time Duration Calculator detects this automatically by adding 24 hours to the end time internally whenever the raw subtraction would otherwise come out negative.

      Worked example: an 11:00 PM to 7:00 AM overnight shift.

      Treating 7:00 AM as belonging to the next day, the span works out to exactly 8 hours, even though 7:00 AM is numerically earlier than 11:00 PM on a single 24-hour clock face.

      Round punch times before calculating

      Number line from 0 to 100 with the value 67 marked025507510067
      Round punch times before calculating.

      Punch rounding adjusts each recorded clock time to the nearest rounding interval before the duration is calculated, not after, since rounding a whole duration and rounding each individual punch can give different results. Worked example: a clock-in of 8:07 and a clock-out of 16:52, rounded to the nearest 15 minutes.

      1. Round the clock-in time. 8:07 rounds to 8:00.

      2. Round the clock-out time. 16:52 rounds to 17:00.

      3. Calculate the rounded span. 17:00 − 8:00 = 9 hours.

      Rounding the raw 8-hour-45-minute duration directly instead would have rounded down to 8 hours 45 minutes, a different and lower figure. Rounding the punches first, then calculating the duration, is what most payroll timekeeping systems actually do.

      Convert the duration to decimal hours

      Scale bar: 1 duration equals 1.98 decimal hours1 duration1.98 decimal hours
      Convert the duration to decimal hours.

      Payroll and billing systems generally expect a decimal number rather than a colon-separated time, since a decimal multiplies cleanly against an hourly rate. Dividing the minutes portion by 60 gives the decimal fraction: 24 minutes converts to 0.4, and 6 minutes converts to exactly 0.1, which is why 6-minute rounding intervals are common in systems built around decimal payroll figures.

      Deduct an unpaid break

      Concept diagram: Inputs leads to Deduct an unpaid break leads to ResultInputsDeduct an unpaid breakResult
      Deduct an unpaid break.

      A break shortens the paid duration without changing the recorded start and end times. The Time Duration Calculator will not let a break exceed the total shift length; a 9-hour break entered against an 8-hour span returns a blocking message rather than a negative duration, since that combination signals a data-entry error rather than a valid input.

      Calculate hours between times overnight

      A security shift runs from 10:15 PM to 6:45 AM, with no break. 1. Convert both times to minutes since midnight. 10:15 PM = 1,335 minutes. 6:45 AM = 405 minutes. 2. Detect the midnight crossing and add 24 hours to the end time. 405 + 1,440 = 1,845 minutes.

      3. Subtract to find the span. 1,845 − 1,335 = 510 minutes.

      4. Format back to hours and minutes. 510 ÷ 60 = 8 remainder 30, so 8 hours 30 minutes.

      To calculate time between those punches, apply the same midnight-crossing adjustment used in the 11:00 PM to 7:00 AM example above. Different start and end times produce a different total.

      Frequently asked questions

      How do you calculate the duration between two times?

      Convert both times to minutes since midnight, subtract the start from the end, add 24 hours first if the shift crosses midnight, then subtract any unpaid break before converting the result back to hours and minutes.

      How do you handle a shift that crosses midnight?

      Add 24 hours to the end time before subtracting, whenever the end time is numerically smaller than the start time, which signals the shift extended into the following day.

      Should I round the punch times or the final duration?

      Round the punch times first, then calculate the duration from the rounded values. Rounding the final duration directly can produce a different, usually lower, figure than rounding each punch.

      How do I convert a duration to decimal hours?

      Divide the minutes portion by 60 and add it to the whole-hours count. For example, 8 hours 30 minutes converts to 8.5 decimal hours.

      What happens if the break is longer than the shift?

      The calculator returns a blocking message rather than a negative duration, since a break exceeding the total shift length indicates a data-entry mistake.

      What rounding intervals are supported?

      5-minute, 6-minute, and 15-minute rounding are the most common intervals, matching the rules used by most timekeeping software.

      Is this different from the Hours Calculator?

      It covers the same start-time-to-end-time duration logic. Both tools answer the same underlying question; use whichever page matches how the calculation was found.

      Summary

      The duration between two clock times comes from subtracting the start time from the end time in minutes, adjusting for a midnight crossing when needed, and subtracting any unpaid break, so an 8:30 AM to 5:30 PM shift with a 30-minute lunch pays 8 hours 30 minutes, or 8.5 decimal hours. The Time Duration Calculator is built for that time duration workflow.

      Rounding punch times before calculating, rather than rounding the finished duration, is what most payroll systems use and can change the final figure by several minutes.