How to use the time duration calculator
Time arithmetic looks easy until midnight gets involved. Subtracting 22:00 from 06:00 gives a negative number if you treat both times as belonging to the same day, yet anyone who works that night shift knows the answer is eight hours. This calculator treats times as points on a 24-hour clock and handles the midnight crossing for you, so you can work out shifts, journeys, study sessions, and event lengths without doing clock arithmetic in your head. It also includes a second calculation on the same page: add or subtract a number of hours and minutes from any base time, which is useful when you need to know what time it will be after a flight, a meeting, or a countdown.
- Enter a start time and an end timeUse the time pickers in 24-hour format. For a same-day period, enter the earlier time first and the later time second, for example 09:00 to 17:30.
- Let overnight periods wrap automaticallyIf the end time is earlier than the start time, the calculator assumes the end belongs to the following day. A shift from 22:00 to 06:00 is therefore eight hours, and the result says so.
- Use the add and subtract section as wellEnter a base time, choose add or subtract, and enter hours and minutes. The result wraps around midnight in either direction, so 23:30 plus two hours is 01:30.
- Read hours, minutes, and total minutesThe headline shows the duration as hours and minutes, which is how people speak about time. The total in minutes is useful for payroll, billing, and spreadsheets, where a single number is easier to multiply.
How the calculation works
Every time is first converted to minutes since midnight. Midnight itself is zero, 09:00 is 540 minutes, and 23:30 is 1,410 minutes. The duration is then the end value minus the start value. If that difference is negative, 1,440 minutes, one full day, is added, which is the same as moving the end time to the next day. If the two times are identical, the duration is zero, because no time has passed between them. This is a deliberate choice: a period from 09:00 to 09:00 is treated as no duration, not as a full 24 hours, since a full day would need a date as well as a time to be unambiguous.
Adding and subtracting uses the same minutes-since-midnight idea, with wrapping in both directions. Subtracting two hours from 01:00 gives 23:00 on the previous day, shown as a clock time without a date. Because the calculator works with clock times only, it cannot know about dates, time zones, or daylight saving changes. A period that crosses a clock change in spring or autumn will be one hour different in real elapsed time, and a journey across time zones needs the local times at each end, not just a subtraction.
Same day, overnight, and edge cases
The most common confusion is whether an end time earlier than the start time is a mistake or an overnight period. This calculator always treats it as overnight, which matches how shifts, flights, and events are usually described. If you actually made a typing error and meant a same-day period, the overnight label in the result is your clue: check the result, and if it says overnight and you did not expect that, swap or correct the times. The other edge case is equal times, which give zero. If you meant a full 24-hour period, you need a date-based calculator rather than a time-only one, because a clock time alone cannot distinguish zero hours from 24 hours.
| Start | End | Duration | Overnight? |
|---|---|---|---|
| 09:00 | 17:30 | 8 hours 30 minutes | No |
| 22:00 | 06:00 | 8 hours | Yes |
| 23:30 | 01:30 | 2 hours | Yes |
| 09:00 | 09:00 | 0 hours | No |
Minutes in the add and subtract section are limited to 0 to 59, which forces you to carry excess minutes into hours, just as you would on a clock. Hours can go up to 1,000, so you can add several days' worth of hours and the result will still be a valid clock time, because the total wraps around the 24-hour clock. That wrapping is correct for asking what time of day it will be, but it does not tell you which date it will be: adding 50 hours to Monday at 10:00 gives Wednesday at 12:00, and only the 12:00 part is shown here.
Practical uses
Shift workers use this kind of calculation to check paid hours, especially when a shift crosses midnight and a simple subtraction would fail. Freelancers and consultants use total minutes to turn a work session into a billable figure, since most invoicing multiplies an hourly rate by a decimal number of hours. Travellers use the add and subtract section to work out arrival times, layover lengths, and what time it will be at home when they land. Students and event organisers use it to split a day into blocks, for example to check that a schedule of talks, breaks, and lunch actually fits between a start and an end time without overrunning.
1. Check a shift before payroll
Enter the shift start and end, note the overnight flag, and use total minutes to convert to decimal hours: divide minutes by 60 before multiplying by an hourly rate.
2. Plan a journey backwards
To find when to leave, subtract travel time from your required arrival time with the subtract option, instead of guessing and arriving late.
3. Keep event schedules honest
Add each session length to its start time in turn. If the last shifted time is later than your venue booking ends, something in the schedule has to move.
This calculator works with clock times only and does not use dates, time zones, or daylight saving rules. For anything where the date matters, such as a multi-day trip, a contract deadline, or a payroll period that spans a clock change, use a date and time calculator and check the result against your local calendar. For everyday same-day and overnight clock arithmetic, however, the minutes-since-midnight method used here is exact.