CALCULATORCASTLE

Time Duration Calculator

Calculate exact duration between two times in hours, minutes, and seconds.

About

Time Duration Calculator

This page holds two calculators. The first finds the hours, minutes and seconds between two clock times on the same day. The second takes a full date and time at each end, so it handles gaps that run across midnight, across a month boundary or across years. Both show the working, and both report the answer in every unit you might need it in: 8:30:00 AM to 5:30:00 PM is 9 hours, which is also 540 minutes, 32,400 seconds and 0.375 of a day.

Working out the duration between two times

Subtracting one time from another is fiddlier than subtracting two ordinary numbers, because minutes and seconds run to 60 rather than to 100. Here is the method, for two times on the same day.

First, identify the starting and the ending time. The goal is to subtract the start from the end, and everything after this is about doing that under the right conditions.

Second, convert to 24-hour time if they are not already in it. AM hours are the same in both systems. For PM hours, add 12: 1:00 PM becomes 13:00. Once both times are in 24-hour form the AM and PM labels stop mattering, which removes most of the ways this goes wrong.

Third, look at which time has the larger number of minutes. If the ending time does, subtract straight down, keeping hours to the left of the colon and minutes to the right:

   13:57
−   9:22
   ------
    4:35

If the starting time has the larger number of minutes, handle the hour and minute parts separately. Add 60 to the minutes of the ending time and take 1 from its hours, then subtract as before:

   13:57        12:117
−   9:58   =>   −   9:58
   ------        ------
                  3:59

That is a borrow, the same move as in ordinary column subtraction, except you borrow 60 instead of 10. Seconds work the same way against the minutes column. The calculator above prints this step for whatever times you enter, so the borrow shows up when it happens.

Why minutes and seconds run to 60

The base-60 habit comes from Babylonian astronomy, and it survived because 60 divides so cleanly. It has twelve divisors, 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 and 60, against nine for 100. That means a third of an hour, a quarter of an hour and a fifth of an hour are all whole numbers of minutes, which matters when you are splitting up time without a calculator to hand. The same choice gave us 360 degrees in a circle and 60 minutes of arc in a degree.

The practical consequence is that clock time is not decimal, and mixing the two systems is the single most common mistake in timekeeping. Seven hours and 45 minutes is 7.75 hours, not 7.45. Writing 7.45 into a timesheet claims 7 hours 27 minutes, which is 18 minutes short.

The 12-hour clock, noon and midnight

The 12-hour clock has one genuinely confusing corner: 12 AM is midnight, at the start of the day, and 12 PM is noon, halfway through it. The hour before 1 AM is 12 AM, and the hour before 1 PM is 12 PM, which is the opposite of what the numbers suggest. This calculator handles both correctly, so 12:00 AM to 12:00 PM comes out as 12 hours rather than zero.

Because of that ambiguity, schedules that matter tend to avoid the labels entirely. Transport timetables, hospitals and the military use 24-hour time, and contracts that mean midnight usually write 11:59 PM or 00:01 to sidestep the argument about which day midnight belongs to.

Spans that cross midnight

When the end time is earlier in the day than the start, the span has run past midnight. A shift from 10:00 PM to 6:00 AM is 8 hours, not minus 16. The first calculator on this page assumes the next day whenever the end is earlier and says so in the result, which is how overnight and night-shift hours are counted.

If a gap runs over more than one night, use the second calculator and give both dates, since only the dates can tell one night from three. That is also the one to use for anything measured in days: a project running from a Monday morning to the following Thursday afternoon has an answer nobody can work out from clock times alone.

Decimal hours, and where payroll rounds

Payroll systems almost always store hours as decimals, so the conversion has to be right. Divide the minutes by 60: 15 minutes is 0.25 hours, 30 is 0.5, 45 is 0.75, and 6 minutes is exactly 0.1. That last one is why legal and consulting time is often billed in six-minute units, since ten of them make a clean hour.

Rounding rules vary and they are worth knowing before you argue about a paycheque. Many US employers round clock-in times to the nearest quarter hour, which is allowed under federal rules only when the rounding is neutral over time, meaning it goes both ways rather than always down. A worker clocking in at 8:07 rounds to 8:00, and at 8:08 rounds to 8:15. The calculator here reports the exact figure, so it gives you the number to compare a rounded total against. For a full week of shifts with breaks taken out, the hours calculator is the better tool.

When a day is not 24 hours

Two things break the assumption that every day contains 86,400 seconds.

The first is daylight saving. On the day the clocks go forward the local day is 23 hours, or 82,800 seconds, and on the day they go back it is 25 hours, or 90,000 seconds. A shift from 11:00 PM to 7:00 AM across a spring-forward boundary is seven hours of actual work even though the clock says eight. Any calculator working purely in clock time, including this one, reports the clock figure, so check the calendar before trusting an overnight total across the changeover weekend.

The second is leap seconds, which have occasionally been added to keep atomic time in step with the Earth's rotation. They matter to satellite systems and to nobody filling in a timesheet, and the practice is due to be discontinued by 2035. Neither affects the arithmetic on this page, but both explain why timekeeping code in the wild is full of special cases.

Time zones and a common trap

Both calculators treat the two times as being on the same clock. If the start and end are in different zones you have to convert one of them first, or the answer will be out by the offset between them. A flight leaving New York at 7:00 PM and landing in London at 7:00 AM has not taken twelve hours, it has taken seven, because London is five hours ahead. Convert both ends to the same zone, or to UTC, and then subtract.

The same caution applies to any timestamp copied out of a computer system, since some are stored in UTC and displayed in local time. Check which one you are looking at before subtracting two of them.

Reading the results on this page

The first panel gives the span as hours, minutes and seconds, then repeats it as a single figure in hours, minutes, seconds, and as a fraction of a day. The second adds whole days to the front and reports the total in days and weeks as well, which is the form to quote for anything long. The step-by-step card under each shows the subtraction the way it would be written by hand, including the borrow when the end minutes are the smaller of the two. For counting whole days between calendar dates rather than an elapsed time, the date calculator handles weekends and holidays too.

Common questions

Frequently asked questions

Convert both to 24-hour time, then subtract the start from the end, borrowing 60 rather than 10 when the end has the smaller minutes. From 8:30:00 AM to 5:30:00 PM is 9 hours, or 540 minutes, or 32,400 seconds.

Borrow an hour. Add 60 to the minutes of the ending time and take 1 from its hours, then subtract normally. For 13:57 minus 9:58, rewrite 13:57 as 12:117, and 12:117 minus 9:58 gives 3:59.

12:00 PM is noon and 12:00 AM is midnight. The 12-hour clock reverses what the numbers suggest, which is why timetables and hospitals use 24-hour time, and why contracts often write 11:59 PM rather than midnight.

Treat the end as falling on the next day. From 10:00 PM to 6:00 AM is 8 hours. The first calculator does this automatically whenever the end time is earlier in the day than the start, and says so in the result.

Divide by 60. So 15 minutes is 0.25 hours, 45 minutes is 0.75, and 6 minutes is 0.1, which is why legal work is often billed in six-minute units. Seven hours 45 minutes is 7.75 hours, not 7.45.

86,400 in an ordinary day, from 24 times 60 times 60. On the day the clocks go forward the local day is 82,800 seconds, and on the day they go back it is 90,000, so an overnight total across those two weekends needs checking by hand.

No, both times are treated as being on the same clock. Convert one end into the other zone first, or convert both to UTC. A flight leaving New York at 7:00 PM and landing in London at 7:00 AM took seven hours, not twelve.

The first takes clock times only and assumes one day, or the next day when the end is earlier. The second takes a full date and time at each end, so it can measure a gap of any length, across months or years.