Time & Date

Time Duration Calculator

Enter a start time and an end time to calculate exactly how many hours and minutes are between them — handles spans that cross midnight automatically.

Start and end time

Duration
Enter both times to calculate.

How the Time Duration formula works

A straightforward time subtraction, adjusted for overnight spans:

Duration = End time − Start time
If End time is earlier than Start time, add 24 hours (the span crosses midnight)

Step-by-step calculation

  1. Convert both times to minutes since midnight.
  2. Subtract the start time from the end time.
  3. If the result is negative, add 24 hours (1,440 minutes) to account for the span crossing into the next day.

Worked example

Start time 9:15 AM, end time 5:45 PM: Duration = 17:45 − 9:15 = 8 hours 30 minutes. A start time of 10:00 PM and end time of 6:00 AM: Duration = 8 hours, correctly crossing midnight.

Frequently asked questions

How is this different from the Date Duration Calculator?

The Date Duration Calculator measures time between two full dates (potentially spanning weeks, months, or years), while this calculator measures time between two clock times, typically within a single day or overnight span.

Does this handle overnight shifts correctly?

Yes — if the end time is earlier than the start time (like a 10 PM to 6 AM shift), the calculator automatically treats it as spanning into the next day rather than returning a negative duration.