Skip to content
TheCalcUniverse

Time Duration Calculator — Exact Hours, Days & Weeks Between Dates

Calculate the exact duration between two dates and times down to the second. Supports business days mode and multiple output formats for project.

✓ Tested formula & cited sources Formula verified 2026-05-18 Runs in your browser — inputs never sent anywhere

The formula

Duration = EndDateTime − StartDateTime

Duration
Duration
Full explanation ↓

How Time Duration 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
DurationThe elapsed time between the start and end date-time values, expressed in hours, days, or a combined weeks:days:hours format.
Duration is the exact elapsed time between two dates and times, expressed in hours, D:H:M, or W:D:H format.

How to Use

  1. Select the start and end dates using the date pickers.
  2. Enter the start and end times in either 12-hour (9:00 AM) or 24-hour (14:30) format.
  3. Toggle "Business Days Only" to count only weekdays (Monday-Friday), excluding weekends from the total.
  4. View the duration in multiple formats: total decimal hours, D:H:M format, and W:D:H format for longer spans.

Quick Reference

1 day24 hours = 1,440 min = 86,400 sec
1 week168 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 formatDays:Hours:Minutes
W:D:H formatWeeks:Days:Hours
Business daysMonday–Friday only

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.

Worked Examples

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.

Frequently Asked Questions

Does it handle overnight shifts?
Yes. Enter the actual end time even if it is earlier than the start time (e.g., start at 11:00 PM, end at 7:00 AM). The calculator handles overnight durations correctly because the date component ensures the end date-time is always after the start date-time overall. This makes the calculator 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. For example, a task from Friday to Monday might show 3 calendar days but only 1 business day.
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 optional. 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.
  • When computing durations that span Daylight Saving Time transitions (e.g., "spring forward" or "fall back"), the calculator uses the date values as entered. For the most accurate results during DST transitions, verify with your local time authority or use UTC times.

Limitations to Know

  • 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.
  • Results use JavaScript's Date engine which handles dates from year 1 to 275760 in most browsers; extreme historical or far-future dates may produce inaccurate results.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "Time Duration Calculator — Exact Hours, Days & Weeks Between Dates." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/time-duration-calculator/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like