Time Duration Calculator

This free online time duration calculator finds the exact time difference between a start time and an end time in hours, minutes, and seconds. Enter both times in 12-hour format and instantly see how long the interval between them lasts, even if it crosses midnight.


How to Use the Time Duration Calculator

  1. Enter the Start Time hour, minute, and (optionally) second, then choose AM or PM.
  2. Enter the End Time hour, minute, and (optionally) second, then choose AM or PM.
  3. Click "Calculate" to see the duration between the two times shown above.
  4. Click "Clear" to reset all fields and start a new calculation.

How the Duration Is Worked Out

The calculator does not count hours on a clock face. It turns each time into a single number, the seconds elapsed since midnight, and subtracts one from the other. The steps are:

  1. Convert the 12-hour time to 24-hour time. For PM times from 1 to 11, add 12 to the hour. 12 AM becomes hour 0 (midnight), and 12 PM stays as hour 12 (noon).
  2. Work out seconds since midnight: hour × 3600 + minute × 60 + second.
  3. Subtract the start value from the end value. If the answer is negative, the end time must be on the next day, so 86,400 seconds (24 hours) are added.
  4. Split the result back into hours (divide by 3600), minutes (remainder divided by 60) and seconds (what is left).

Worked Examples

Office shift: 9:15:00 AM to 6:40:30 PM. The start is 9 × 3600 + 15 × 60 = 33,300 seconds. The end is 18:40:30, which is 18 × 3600 + 40 × 60 + 30 = 67,230 seconds. The difference is 33,930 seconds, or 9 hours, 25 minutes and 30 seconds.

Night shift crossing midnight: 10:30 PM to 6:15 AM. The start is 81,000 seconds and the end is 22,500 seconds. 22,500 − 81,000 is negative, so 86,400 is added, giving 27,900 seconds, which is 7 hours and 45 minutes.

Some intervals people often check, and the result this calculator gives:

StartEndDuration
9:00 AM5:30 PM8 h 30 min
10:00 AM1:45 PM3 h 45 min
11:45 AM12:15 PM0 h 30 min
6:00 PM2:00 AM8 h 0 min
11:00 PM7:00 AM8 h 0 min
12:00 AM11:59:59 PM23 h 59 min 59 s

Getting 12 AM and 12 PM Right

Most wrong answers come from the two twelves. 12:00 AM is midnight, the start of the day, and 12:30 AM is half an hour after midnight. 12:00 PM is noon. So a lunch break from 12:30 PM to 1:15 PM is 45 minutes, but if you pick AM for the start by mistake, the calculator sees a gap from 00:30 to 13:15 and reports 12 hours 45 minutes.

Railway and airline tickets in India print times in 24-hour format. To enter 21:50, subtract 12 from the hour and choose PM (9:50 PM). For 00:20, enter 12:20 AM.

Where This Is Useful, and Its Limits

  • Checking the length of a work shift, a class, an exam slot or a meeting before filling in a timesheet.
  • Finding journey time from a departure and arrival time on the same or the next day.
  • Measuring gaps between two timestamps in a log or recording, down to the second.

Because only clock times are entered, the tool assumes the two times are less than 24 hours apart. A trip that runs for 30 hours will show as 6 hours. If the start and end are identical, the result is 0, not 24 hours. For spans over several days, use the Date Difference Calculator, and for adding up many separate shifts, use the Hours Calculator. Daylight saving time does not apply in India, so IST times can be subtracted directly; if you compare times in a country that changes its clocks, the result can be off by an hour on the changeover night.

Frequently Asked Questions

It converts both the start and end times to 24-hour format, then to total seconds since midnight, and subtracts the start time from the end time to get the duration in hours, minutes, and seconds.

Yes. If the end time is earlier than the start time, the calculator automatically adds 24 hours so the duration reflects an overnight span correctly.

No, the Second field is optional for both start and end time. If left blank, it is treated as 0 seconds.

Divide the minutes by 60 and add them to the hours. For example, 7 hours 45 minutes is 7 + 45 ÷ 60 = 7.75 hours, and 8 hours 20 minutes is about 8.33 hours. Multiply decimal hours by an hourly rate to get pay.

One of the times probably has the wrong AM or PM. Remember that 12 AM is midnight and 12 PM is noon. A time like 12:30 at lunchtime must be entered as 12:30 PM.
5.0 out of 5 (1 rating)
Rate this calculator:
Was this tool helpful?