How to Calculate Time Across Midnight
Calculating time across midnight can seem confusing because the clock resets from 11:59 PM to 12:00 AM. However, the calculation becomes simple once you understand how to count the hours before and after midnight.
For example, if you start work at 10:00 PM and finish at 6:00 AM the next day, your shift lasts 8 hours. You cannot find the correct answer by simply subtracting 10 from 6. You need to account for the change of day.
In this guide, you’ll learn how to calculate time across midnight using simple formulas, examples, and practical tips. Whether you’re calculating overnight work hours, travel time, sleep duration, or the time between two events, these methods will help you get the correct result.

What Does Calculating Time Across Midnight Mean?
Calculating time across midnight means finding the time difference between two times when the end time falls on the following day.
This often happens when:
- You work an overnight shift.
- You travel late at night and arrive the next morning.
- You go to sleep before midnight and wake up the next day.
- An event starts in the evening and finishes after midnight.
- You need to calculate the duration between two timestamps on different dates.
For example, if a shift starts at 9:00 PM on Monday and ends at 5:00 AM on Tuesday, the calculation crosses midnight because the starting and ending times belong to different days.
The important thing to remember is that midnight marks the beginning of a new day, not the end of the current day.
How to Calculate Time Across Midnight
The easiest method is to divide the calculation into two parts: the time remaining before midnight and the time elapsed after midnight.

Follow these steps:
- Identify the starting time and ending time.
- Calculate the hours from the starting time to midnight.
- Calculate the hours from midnight to the ending time.
- Add both durations together.
Example 1: From 10:00 PM to 6:00 AM
Suppose you start working at 10:00 PM and finish at 6:00 AM the next day.
| Calculation | Duration |
|---|---|
| 10:00 PM to midnight | 2 hours |
| Midnight to 6:00 AM | 6 hours |
| Total elapsed time | 8 hours |
The total duration is 2 + 6 = 8 hours.
This method works for any overnight period, even when the starting and ending times are only a few minutes apart from midnight.
Example 2: From 11:30 PM to 4:15 AM
Imagine you begin a task at 11:30 PM and finish at 4:15 AM the next day.
| Calculation | Duration |
|---|---|
| 11:30 PM to midnight | 30 minutes |
| Midnight to 4:15 AM | 4 hours 15 minutes |
| Total elapsed time | 4 hours 45 minutes |
The total duration is 4 hours and 45 minutes.
Example 3: From 8:45 PM to 12:30 AM
Suppose an event begins at 8:45 PM and ends at 12:30 AM the next day.
| Calculation | Duration |
|---|---|
| 8:45 PM to midnight | 3 hours 15 minutes |
| Midnight to 12:30 AM | 30 minutes |
| Total elapsed time | 3 hours 45 minutes |
The event lasts 3 hours and 45 minutes.
A Simple Formula for Overnight Time Calculations
You can also use a formula to calculate time across midnight without splitting the calculation manually.
First, convert both times into minutes after midnight. For example: 10:00 PM = 1,320 minutes and 6:00 AM = 360 minutes
Because the ending time is earlier than the starting time, add 1,440 minutes to the ending time. There are 1,440 minutes in a full day.
Formula:
Duration in minutes = Ending time − Starting time + 1,440
Using the example:
360 − 1,320 + 1,440 = 480 minutes
Convert 480 minutes into hours:
480 ÷ 60 = 8 hours
Therefore, the total duration is 8 hours.
This formula is especially helpful when working with digital time records, schedules, and calculations involving minutes.
Important: Add 1,440 minutes only when the end time is on the following day. If you already have complete dates and timestamps, subtract the actual timestamps instead.
How to Calculate Overnight Time Using the 24-Hour Clock

The 24-hour clock can make overnight calculations easier because it uses hours from 00:00 to 23:59.
Midnight is written as 00:00, while 10:00 PM is written as 22:00.
Here are some common overnight calculations:
| Start time | End time next day | Total duration |
|---|---|---|
| 22:00 | 06:00 | 8 hours |
| 23:00 | 07:00 | 8 hours |
| 21:30 | 05:30 | 8 hours |
| 23:30 | 04:00 | 4 hours 30 minutes |
| 20:15 | 00:45 | 4 hours 30 minutes |
| 18:00 | 02:00 | 8 hours |
When the ending time is earlier than the starting time, the calculation usually crosses midnight if the event is known to end the next day.
For a refresher on the two clock systems, read our guide to 12-Hour vs. 24-Hour Time: Key Differences Explained.
How to Calculate Overnight Work Hours
Overnight work shifts are a common reason people need to calculate time across midnight.
To find the total shift duration, subtract the starting time from the ending time while accounting for the date change.
For example, an employee starts work at 10:00 PM and finishes at 7:00 AM the next day.
| Shift period | Duration |
|---|---|
| 10:00 PM to midnight | 2 hours |
| Midnight to 7:00 AM | 7 hours |
| Total shift length | 9 hours |
The total shift length is 9 hours.
If the employee takes an unpaid 30-minute break, the working time is:
9 hours − 30 minutes = 8 hours 30 minutes.
Always subtract unpaid breaks when calculating actual working time. Also, if you need to calculate several shifts or payroll hours, check your workplace’s rules for rounding, breaks, and overtime.
How to Calculate Time Across Midnight in Minutes
Sometimes you need the answer in minutes instead of hours.
For example, suppose you want to calculate the time from 11:20 PM to 1:50 AM the next day.
- 11:20 PM to midnight = 40 minutes.
- Midnight to 1:50 AM = 1 hour 50 minutes, or 110 minutes.
- Total = 40 + 110 = 150 minutes.
Therefore, the elapsed time is 150 minutes, which is also 2 hours and 30 minutes.
To convert hours and minutes into total minutes, multiply the number of hours by 60 and then add the remaining minutes.
For example:
2 hours 30 minutes = (2 × 60) + 30 = 150 minutes.
Common Mistakes to Avoid
When calculating time across midnight, a few simple mistakes can lead to incorrect results.
1. Subtracting the times without accounting for the next day
If you subtract 10:00 PM from 6:00 AM directly, you may get a negative result. Remember that 6:00 AM is on the following day in this example.
2. Confusing 12:00 AM with 12:00 PM
12:00 AM means midnight, while 12:00 PM means noon. Mixing them up can cause a difference of 12 hours in your calculation.
3. Forgetting minutes
For a shift from 10:45 PM to 6:15 AM, the total duration is 7 hours 30 minutes, not 8 hours. Calculate the minutes carefully for an accurate result.
4. Ignoring the actual dates
An earlier end time does not always mean an event crossed midnight. If you have the dates, use them to determine the actual duration. An event could also last more than 24 hours.
5. Forgetting breaks
The elapsed time between clock-in and clock-out may be longer than the number of hours actually worked. Subtract unpaid breaks when needed.
Frequently Asked Questions
How do you calculate hours between 10 PM and 6 AM?
From 10:00 PM to midnight is 2 hours. From midnight to 6:00 AM is another 6 hours. The total elapsed time is 8 hours.
How many hours are there between 11 PM and 7 AM?
There are 8 hours between 11:00 PM and 7:00 AM the next day.
How do you calculate time from 11:30 PM to 12:30 AM?
There are 30 minutes from 11:30 PM to midnight and another 30 minutes from midnight to 12:30 AM. The total is 1 hour.
Does midnight count as the start or end of a day?
Midnight, written as 12:00 AM or 00:00 in the 24-hour format, marks the start of a new calendar day.
Can I calculate overnight time without a calculator?
Yes. Calculate the time remaining until midnight, then add the time from midnight to the ending time. For more complicated calculations, converting the times to minutes can help.
How do I calculate the time between two dates?
When the start and end dates are different, use the complete date and time for each point. Subtract the starting timestamp from the ending timestamp to find the elapsed duration. For periods longer than one day, include every full day between them.
Final Thoughts
Calculating time across midnight is straightforward once you account for the change of day. You can split the duration at midnight, use the 24-hour clock, or convert both times into minutes and apply a simple formula.
These methods are useful for overnight shifts, travel schedules, sleep tracking, and everyday planning. If you want to find a future time quickly, try our Hours From Now Calculator to calculate the exact time and date after adding a number of hours.
With the right method, you can calculate overnight durations accurately without getting confused by the clock resetting at midnight.
