Skip to main content
DATE & DURATION

Time Duration Calculator

Enter a start time and an end time to get the elapsed duration, including shifts that cross midnight.

Elapsed time between two clock times

This calculator works with clock times only, not full dates, which makes it a fast way to check a shift length, a commute, or how long a task took when you only have the start and end time. If the end time is earlier than the start time, it is treated as happening the next day: 23:30 to 01:15 comes out as 1 hour 45 minutes, not a negative number.

Shifts longer than a day

For a shift or task that spans more than 24 hours, add the number of extra full days on top of the clock times. A 09:00-to-09:00 shift with 1 extra day, for example, comes out as exactly 1 day (24 hours), and the calculator supports any number of extra days.

Want the background? Read our comprehensive guide: Time Zones and DST for Developers.

How to use this tool

  1. Enter the start time.
  2. Enter the end time. If it is earlier than the start time, it is read as being on the next day.
  3. Add extra whole days if the duration spans more than one midnight.
  4. Select Calculate to see the duration in seconds, minutes, hours and days.

Examples

A shift that crosses midnight, and one that does not.

Crossing midnight

23:30 to 01:15

Duration
1 hour 45 minutes

The end time is earlier than the start time, so it is read as being on the next day.

Same day

09:00 to 17:30

Duration
8 hours 30 minutes

A full day, stated explicitly

09:00 to 09:00, plus 1 extra day

Duration
1 day

Frequently Asked Questions

How is a shift that crosses midnight handled?
If the end time is earlier than the start time, the calculator assumes the end time is on the following day. For example 23:30 to 01:15 is treated as 1 hour 45 minutes.
Can I calculate a duration longer than 24 hours?
Yes. Add the number of extra full days, and they are added on top of the difference between the two clock times.
What if the start and end time are the same?
The duration is 0 seconds, unless you add extra days, in which case it is exactly that many whole days.
Does this account for daylight saving time?
No, because it works with plain clock times and does not use a date or time zone. For a duration across a specific calendar date and time zone, use the Date Difference Calculator or the Timezone Converter instead.