How to Calculate Time Across Midnight

To calculate a duration across midnight, treat the end time as occurring on the following day.

Example:

11:00 PM to 2:00 AM

Split the interval:

  • 11:00 PM to midnight = 1 hour
  • Midnight to 2:00 AM = 2 hours

Total:

3 hours

The important step is recognizing that the end time belongs to the next day rather than trying to subtract it as a same-day clock value.

Timeline showing 11:00 PM to midnight as 1 hour and midnight to 2:00 AM as 2 hours, totaling 3 hours. View larger image
Split an overnight interval at midnight: 1 hour before midnight plus 2 hours after midnight equals 3 hours.

Full-size image 100%

Timeline showing 11:00 PM to midnight as 1 hour and midnight to 2:00 AM as 2 hours, totaling 3 hours.

Drag or scroll to inspect the diagram. Use + and − to adjust the size.

The simplest midnight method

For an interval such as:

9:30 PM to 1:15 AM

Calculate the portion before midnight:

9:30 PM to midnight:

2 hr 30 min

Then calculate the portion after midnight:

Midnight to 1:15 AM:

1 hr 15 min

Add them:

3 hr 45 min

This method is easy to visualize and works well for manual calculations.

Midnight examples

StartEndDuration
11:00 PM2:00 AM3 hr
10:30 PM6:00 AM7 hr 30 min
11:45 PM12:15 AM30 min
9:30 PM1:15 AM3 hr 45 min
6:00 PM2:30 AM8 hr 30 min

Each example assumes one rollover into the following day.

Calculate across midnight using minutes

A deterministic method is to convert both times to minutes after midnight.

Example:

10:30 PM to 6:00 AM

10:30 PM in 24-hour time is 22:30:

22 × 60 + 30 = 1,350 minutes

6:00 AM:

360 minutes

Because the end occurs the next day, add 1,440 minutes:

360 + 1,440 = 1,800

Subtract:

1,800 − 1,350 = 450 minutes

450 minutes equals:

7 hr 30 min

A short interval across midnight

Midnight rollover can also happen in a very short duration.

Example:

11:50 PM to 12:10 AM

11:50 PM to midnight = 10 minutes.

Midnight to 12:10 AM = 10 minutes.

Total:

20 minutes

The fact that the clock changes dates does not make the duration long.

An evening-to-morning example

Suppose:

  • Start: 7:45 PM
  • End: 4:15 AM

Before midnight:

7:45 PM to midnight = 4 hr 15 min

After midnight:

midnight to 4:15 AM = 4 hr 15 min

Total:

8 hr 30 min

Decimal form:

8.50 hours

When you should not automatically roll into the next day

An end time earlier than the start only implies the next day when that matches the intended interval.

For example:

6:00 AM to 2:00 PM

is a normal same-day duration of 8 hours.

No rollover is needed because the end is later than the start.

Likewise, if explicit calendar dates are available, use those dates rather than inferring the day solely from the clock values.

What about a 24-hour or multi-day duration?

Clock values alone cannot distinguish:

  • 8:00 AM to 8:00 AM with zero elapsed time;
  • 8:00 AM to 8:00 AM the next day;
  • the same clock time several days later.

A simple time-of-day calculator therefore cannot reliably represent multi-day intervals without explicit dates.

Do not assume a full 24 hours merely because the clock values match.

Across midnight versus overnight work hours

Elapsed duration and worked time are related but not identical.

Example:

10:00 PM to 6:00 AM = 8 hours elapsed

If the work shift includes a 30-minute unpaid break:

worked time = 7 hr 30 min

A neutral duration calculator reports the elapsed span. A work-hours calculator can additionally subtract excluded breaks.

Common mistakes

Avoid:

  • subtracting 2:00 AM directly from 11:00 PM as a same-day time;
  • adding 24 hours to intervals that do not cross midnight;
  • assuming every earlier end time represents a multi-day event;
  • confusing elapsed duration with net worked time;
  • treating equal start and end clock values as unambiguously 24 hours.

Calculate an overnight duration automatically

Time Duration Calculator

Report an issue

Nothing is sent until you send the email from your email app.