Time Duration Calculator
Find the hours between two times or dates: elapsed time as h:mm:ss, decimal hours, minutes and days, with overnight spans handled. Free and instant.
Leave both dates blank to find the hours between two times on one day. If the end time is earlier than the start time it counts as the next day.
Use format like 9:00 AM or 14:30
Use both dates for a span of days. With dates, the end must come after the start.
For an overnight span, enter the actual end time (e.g., start 11:00 PM, end 7:00 AM). With no dates the end is taken as the next day; with dates, pick the next day as the end date.
Results
Total Hours
8.50
- Hours and Minutes
- 8 hours 30 minutes
- Total Minutes
- 510
- Total Seconds
- 30600
- Hours:Minutes:Seconds
- 8:30:00
- Duration (D:H:M)
- 0d 8h 30m
- Duration (W:D:H)
- 0w 0d 8h
- Start
- 9:00 AM
- End
- 5:30 PM
- Mode
- All Days
The formula
Duration = EndDateTime − StartDateTime
- Duration
- Duration
Worked example — Start Time 9:00 AM, End Time 5:30 PM
Total Hours = 8.50
How Time Duration Calculator Works
Duration = EndDateTime − StartDateTime
Calculate the exact elapsed time between two dates and times. The duration is computed by subtracting the start date-time from the end date-time, automatically handling same-day durations, multi-day spans, and overnight shifts. Results are displayed in multiple formats for flexibility: total hours, D:H:M (days:hours:minutes), and W:D:H (weeks:days:hours).
- Duration
- Duration — The elapsed time between the start and end date-time values, expressed in hours, days, or a combined weeks:days:hours format.
Worked Examples
A shift runs from 9:00 AM to 5:30 PM on the same day. How many hours is that?
startDate = · startTime = 9:00 AM · endDate = · endTime = 5:30 PM · businessDays = no
8.50 hours (8 hours 30 minutes, 510 minutes, 8:30:00)
9:00 AM is minute 540 of the day and 5:30 PM is minute 1050. 1050 - 540 = 510 minutes, and 510 / 60 = 8.5 hours. No dates are needed for a single day.
A night worker clocks in at 10:00 PM and out at 6:00 AM. How long was the shift?
startDate = · startTime = 10:00 PM · endDate = · endTime = 6:00 AM · businessDays = no
8.00 hours (8 hours 0 minutes, 480 minutes)
The end time is earlier than the start time, so it is the next day: 6:00 AM + 24 hours = minute 1800, and 1800 - 1320 (10:00 PM) = 480 minutes = 8 hours.
A support ticket was opened on Friday, June 5, 2026 at 2:30 PM and answered on Monday, June 8, 2026 at 9:15 AM. How long did the customer wait?
startDate = 2026-06-05 · startTime = 2:30 PM · endDate = 2026-06-08 · endTime = 9:15 AM · businessDays = no
66.75 hours (2d 18h 45m, 4,005 minutes, 66:45:00)
From Friday 2:30 PM to Monday 2:30 PM is 3 days (72 hours). The answer came 5 hours 15 minutes before that mark, so 72 - 5.25 = 66.75 hours.
Alex is a project manager tracking how long a critical server migration took. The maintenance window started on Friday, June 5, 2026 at 10:00 PM and ended on Saturday, June 6, 2026 at 4:30 AM. He needs the exact duration for the post-mortem report.
startDate = 2026-06-05 · startTime = 10:00 PM · endDate = 2026-06-06 · endTime = 4:30 AM · businessDays = no
6.50 hours (390 minutes, 0d 6h 30m)
The migration took exactly 6.5 hours (390 minutes). The D:H:M display shows 0d 6h 30m, confirming the work completed within a single overnight window. This is under the planned 8-hour outage window, so the migration was successful. Alex can report this exact figure to stakeholders.
Priya is calculating billable hours for a consulting engagement that ran from Monday, March 9 at 9:00 AM to Friday, March 13 at 5:00 PM. She needs to exclude weekends from the billable total since the client only pays for business days.
startDate = 2026-03-09 · startTime = 9:00 AM · endDate = 2026-03-13 · endTime = 5:00 PM · businessDays = yes
104.00 hours (4d 8h 0m); 5 business days
Total elapsed time is 104 hours, with 5 business days (Monday through Friday). The duration in D:H:M format is 4d 8h 0m. If Priya bills at $150/hr, the total invoice is $15,600 for the week. The business days count (5) confirms all work happened on weekdays — no weekend billing concerns.
Tom is tracking his newborn baby's feeding schedule. The last feeding was on May 15 at 2:15 AM, and the next feeding is scheduled for May 15 at 5:45 AM. He wants to know the exact interval.
startDate = 2026-05-15 · startTime = 2:15 AM · endDate = 2026-05-15 · endTime = 5:45 AM · businessDays = no
3.50 hours (210 minutes, 0d 3h 30m)
The interval is exactly 3.5 hours (210 minutes, or 12,600 seconds). In D:H:M format: 0d 3h 30m. Newborns typically feed every 2-4 hours, so this 3.5-hour gap is within the normal range. Tom can use the calculator to track feeding intervals throughout the day and spot patterns.
Understanding the Result
This calculator computes the exact time difference between two dates and times, handling same-day durations, multi-day spans, and overnight shifts automatically. The business days mode excludes weekends, making it useful for project management timelines, payroll hours calculation, and scheduling applications that only operate on weekdays. Unlike the Day Counter which counts full calendar days, this calculator returns precise hours, minutes, and seconds between two specific moments in time.
How to Use
- To find the hours between two times on one day, leave both dates blank and just enter the start and end times. An end earlier than the start counts as the next day.
- To measure across days, select the start and end dates using the date pickers.
- Enter the start and end times in either 12-hour (9:00 AM) or 24-hour (14:30) format.
- Toggle "Business Days Only" to count only weekdays (Monday-Friday), excluding weekends from the total.
- View the duration in multiple formats: total decimal hours, D:H:M format, and W:D:H format for longer spans.
Quick Reference
| 9:00 AM to 5:00 PM | 8 hours |
| 8:00 AM to 5:00 PM | 9 hours |
| 10:00 PM to 6:00 AM | 8 hours (next day) |
| 7.5 hours | 7 hours 30 minutes |
| 15 / 30 / 45 minutes | 0.25 / 0.50 / 0.75 hours |
| 1 day | 24 hours = 1,440 min = 86,400 sec |
| 1 week | 168 hours = 10,080 min = 604,800 sec |
| 1 month (30 days) | 720 hours = 43,200 min |
| 1 year (365 days) | 8,760 hours = 525,600 min |
| D:H:M format | Days:Hours:Minutes |
| W:D:H format | Weeks:Days:Hours |
| Business days | Monday–Friday only |
Frequently Asked Questions
- How do I calculate the hours between two times?
- Leave the dates blank and enter the two times. 9:00 AM to 5:30 PM is 8 hours 30 minutes, which is 8.50 decimal hours, 510 minutes and 30,600 seconds (8:30:00). By hand: convert each time to minutes after midnight (9:00 AM = 540, 5:30 PM = 1050), subtract (1050 - 540 = 510), then divide by 60 for hours. 9:15 AM to 2:45 PM is 5 hours 30 minutes, or 5.5 hours.
- How do I calculate elapsed time across midnight?
- With the dates blank, an end time earlier than the start is taken as the next day: 10:00 PM to 6:00 AM is 8 hours. Add 24 hours to the end time before subtracting (6:00 AM = 360 + 1,440 = 1,800 minutes; 1,800 - 1,320 = 480 minutes). If the span is longer than a day, enter both dates.
- How do I calculate the time between two dates and times?
- Enter the start date and time and the end date and time. Friday 2026-06-05 at 2:30 PM to Monday 2026-06-08 at 9:15 AM is 66 hours 45 minutes (66.75 hours, 4,005 minutes), shown as 2 days 18 hours 45 minutes. The calculator counts whole days between the dates and then the difference between the clock times.
- How do I convert the result to decimal hours or minutes?
- The results already show decimal hours, hours and minutes, total minutes, total seconds and H:MM:SS. By hand, divide the minutes by 60: 510 minutes is 8.5 hours, and 45 minutes is 0.75 hours. For payroll, use the decimal figure.
- Does it handle overnight shifts?
- Yes. Enter the actual end time and choose the next calendar day as the end date (e.g., start 11:00 PM on June 5, end 7:00 AM on June 6 = 8 hours). The end date and time together must come after the start; if they do not, the calculator tells you so instead of guessing. This makes it ideal for tracking overnight work shifts, flights that cross midnight, and server maintenance windows.
- What is the difference between calendar days and business days?
- Calendar days count every day including weekends. Business days count only Monday through Friday, excluding Saturday and Sunday from the duration. Use business days mode for work-related calculations like project task durations that should not include non-working days. The count includes both the start and end dates, so a task from Friday to the following Monday spans 3 days of elapsed time but 2 business days (Friday and Monday).
- What time formats are supported?
- Both 12-hour format (e.g., 9:00 AM, 2:30 PM) and 24-hour format (e.g., 09:00, 14:30) are supported. Hours and minutes are required; seconds are not supported. The calculator also exports the duration in different views: total decimal hours for payroll, D:H:M for human readability, and W:D:H for very long durations spanning multiple weeks.
- How does this calculator differ from the Day Counter?
- The Day Counter counts full calendar days between two dates and provides business day counts, ideal for "how many days until my vacation" type questions. This Time Duration calculator goes further: it accepts both date AND time, so it computes exact elapsed hours, minutes, and seconds between two specific moments. Use this when you need precision — for example, "how many hours between 2:30 PM on Friday and 9:15 AM on Monday" rather than just "how many days between Friday and Monday."
- Can I use this for calculating flight durations across time zones?
- This calculator works with local wall-clock times as entered. For flights crossing time zones, you should first convert both departure and arrival times to the same time zone (use the Time Zone calculator), then enter the converted times here. For example, a flight departing New York at 6:00 PM EST and arriving London at 6:00 AM GMT should be entered with both times in GMT: 11:00 PM to 6:00 AM = 7 hours duration.
- How are results rounded?
- Total seconds are exact integers. Total minutes are floored (rounded down) from the millisecond difference. Total hours are displayed to 2 decimal places for payroll precision. The D:H:M and W:D:H formats use whole numbers for each unit — for example, 26 hours displays as "1d 2h 0m" rather than a fractional day value. Week calculations use 7-day weeks.
Pro Tips
- →Use W:D:H format for durations longer than a week. For example, 340 hours displays as "2w 0d 4h" — much more readable than "14d 4h 0m." This is especially useful for project timelines, vacation planning, and extended service contracts.
- →The total seconds output is the most precise measurement — use it to verify other calculations or when precision matters (e.g., scientific experiments, server uptime tracking, or athletic timing). There are exactly 86,400 seconds in a day and 3,600 in an hour.
- →Combine with the Day Counter for a complete time analysis toolkit: use Day Counter for "how many calendar/business days between these dates," then use Time Duration for the exact hours within that span. Together they give you both the macro and micro view of any time range.
- →The Business Days mode counts only weekdays (Mon-Fri) that fall between the start and end dates, regardless of the hour range. This is the count of distinct business dates, not the fraction of business hours — for hourly business-hours calculations, use the Time Zone calculator's business hours overlay.
- →The calculator subtracts the wall-clock times exactly as entered and ignores Daylight Saving Time, so the answer is the same wherever you open it. On a spring-forward day, 1:00 AM to 4:00 AM is shown as 3 hours although only 2 hours actually elapse on the clocks; for exact elapsed time across a DST change, enter both times in UTC.
Limitations to Know
- •With the dates blank the two times are on one day or the next (a span of up to 24 hours). For anything longer, enter both dates.
- •This calculator works with local wall-clock times and does not automatically account for time zone differences or Daylight Saving Time transitions. For durations spanning time zones, convert all times to a common zone first using the Time Zone calculator.
- •Business days counting excludes only Saturdays and Sundays — it does not exclude public holidays, which vary by country and year. For project management, combine this with a holiday-aware calendar for precise workday estimates.
- •The business days count is based on the calendar dates spanned (distinct business dates between start and end), not the number of business hours. A task spanning 2 business days may have only a few working hours.
- •End time must be after start time in absolute terms (the date+time combination). Overnight shifts on the same date require selecting the next day as the end date.
- •Dates are read as proleptic Gregorian calendar dates from year 0001 to 9999; historical calendar changes (such as the 1582 Gregorian reform) are not modelled. Impossible dates such as February 31 are rejected.
Cite this calculator
TheCalcUniverse. "Time Duration Calculator: Hours Between Two Times." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/time-duration-calculator/. Accessed October 25, 2026.
Embed this calculator on your site
You may also like
-
Mathematics
Date Calculator
Add or subtract years, months, weeks, and days from any date. Includes a business-days-only mode that skips weekends, leap year handling, and month-end.
Open calculator → -
Mathematics
Day Counter
Count the exact days between two dates, with business-day exclusion, an end-date inclusion toggle and week/month/year conversions.
Open calculator → -
Mathematics
Time Calculator
Add and subtract hours, minutes, seconds and days. Get the total as h:mm:ss, decimal hours and minutes, or the clock time you land on. Free, no sign-up.
Open calculator → -
Mathematics
Day of Week
Find the day of the week for any date using Zeller's congruence. Features a perpetual calendar algorithm explanation and historical context.
Open calculator →