Skip to content
RK Calculator
Menu

Time Duration Calculator

Find the time between two clock times (including overnight spans) or between two dates and times, shown as hours, minutes and seconds and as decimal hours, minutes and days, with a clearly stated rule for midnight and daylight-saving changes.

Change the values and press Calculate to work out your own figures.

Between two times

Find how long it is from one clock time to another. If the end time is earlier, it is taken to be the next day, so overnight shifts work too.

About start timeHours, minutes and optional seconds. In 12-hour format choose AM or PM; 12:00 AM is midnight and 12:00 PM is noon. Use Now for the current time.
About end timeSame format as the start time. In times mode an end time earlier than the start is read as the next day.
About time formatHow times are typed and shown. Results are identical in both formats.
About when start and end times are the sameChoose 24 hours for a shift that starts and ends at the same time on consecutive days.
Result
Duration
9 hours
Decimal hours
9
Decimal minutes
540
Total seconds
32,400

From 8:30 AM to 5:30 PM.

Show the working
  1. In 24-hour time: 08:30 to 17:30.
  2. Difference: 32400 seconds = 9 hours.

Between two dates and times

Find the time between two dates, with optional times. Every day counts as 24 hours unless you pick a time zone, which accounts for daylight-saving changes.

About start dateCalendar date of the start.
About end dateCalendar date of the end. It may be before the start; the result then shows how long before.
About start timeHours, minutes and optional seconds. In 12-hour format choose AM or PM; 12:00 AM is midnight and 12:00 PM is noon. Use Now for the current time.
About end timeSame format as the start time. In times mode an end time earlier than the start is read as the next day.
About time formatHow times are typed and shown. Results are identical in both formats.
About time zone (for daylight saving)Leave as 'none' to count clock time with every day 24 hours long. Pick a time zone to get real elapsed time when a daylight-saving change falls in between.
About repeated hour when clocks go backWhen clocks go back, times such as 1:30 AM happen twice; this picks which one you mean.

How to work out the time between two times

  1. Type the start and end times, for example 8:30 AM and 5:15 PM. Switch the time format to 24-hour if you prefer 08:30 and 17:15. Seconds are optional (8:30:15 PM).
  2. If the end time is earlier than the start, the calculator assumes it is on the next day, so a night shift from 10 PM to 6 AM is 8 hours.
  3. For spans longer than a day, use the second calculator and enter the dates as well.

The answer is shown in hours, minutes and seconds, and as decimal hours and minutes, which is what most timesheets and payroll systems need. For example, 8:30 AM to 5:15 PM is 8 hours 45 minutes, or 8.75 hours.

Converting to decimal hours

Decimal hours = hours + minutes ÷ 60 + seconds ÷ 3600
45 minutes = 45 ÷ 60 = 0.75 hours
7 hours 20 minutes = 7 + 20 ÷ 60 = 7.333333 hours

Midnight and equal times

12:00 AM is midnight at the start of the day and 12:00 PM is noon. When the start and end times are the same, the calculator gives 0 by default; choose "A full day has passed" if you mean the same time the next day (24 hours). A time of 24:00 isn't accepted: use 00:00 with the next day's date instead.

Daylight-saving time

By default every day counts as 24 hours, which gives the difference between the two clock readings. When the clocks change in between, the real time that passed is an hour more or less. Choose a time zone to get the real elapsed time: in New York, from 11 PM on 7 March 2026 to 3:30 AM on 9 March is 28.5 hours on the clock but 27.5 hours in real time, because the clocks went forward on 8 March.

With a time zone chosen, a time skipped when the clocks go forward (such as 2:30 AM on the spring change in the US) is rejected, and for a time that happens twice when they go back you can choose the first or second occurrence. Time-zone rules come from your browser, which keeps them up to date.

Questions

How many hours is 9 AM to 5 PM?

8 hours. From 9 AM to 12 PM is 3 hours and from 12 PM to 5 PM is 5 more.

How do I calculate hours worked overnight?

Enter the start and end times as they appear on the clock. When the end time is earlier than the start, the calculator counts it as the next morning, so 10 PM to 6 AM gives 8 hours.

Are leap seconds included?

No. Like almost all clocks and computer systems, the calculator treats every minute as exactly 60 seconds.

Sources

Limitations

  • Wall-clock mode (the default) treats every day as 24 hours: across a DST change the result is the clock difference, which differs from real elapsed time by the DST shift (usually 1 hour). Choose a time zone for real elapsed time.
  • Leap seconds are ignored in both modes.
  • Times-only mode cannot span more than 24 hours; use the dates-and-times mode for longer spans.
  • Historical time-zone offsets are only as accurate as the bundled IANA tzdb release; dates before about 1970 may be less reliable.
  • '24:00' as an end-of-day time is not accepted; use 00:00 on the following date.

Formula version 0.1.0Reviewed