Time Duration Calculator — Hours, Days & Shifts

Time Tools

Time Duration Calculator

Precisely measure the gap between two times, two dates, or combine multiple durations - with overnight shifts, break deduction, business days, and payroll-ready decimal hours handled automatically.

Lunch, coffee, unpaid pauses.
Overnight shift detected - result rolls into the next day.

Add two or more durations together. Useful for totalling timesheets, workout logs, or project hours.

Hours Minutes Seconds
- Duration
All Units
1,247 people find this calculator useful ❤️

How to Use This Calculator

  1. Choose your mode. Times measures gaps within a day (or across midnight). Dates measures full date ranges down to the second. Add / Subtract combines or subtracts multiple durations.
  2. Enter your values. Use the native time and date pickers, or type directly. Both formats accept HH:MM and YYYY-MM-DD.
  3. Add options if relevant. Subtract unpaid break time from shifts, count only business days for deadlines, or include the end day for inclusive ranges.
  4. Click Calculate Duration. Every relevant unit is computed at once - including payroll-ready decimal hours.
  5. Copy any value. Tap the copy icon next to a metric to send it to your clipboard.

What Makes This Different

Most duration calculators only handle one scenario. This one covers the situations people actually search for:

  • Overnight shifts. Enter 22:00 to 06:00 and it returns 8 hours, not a negative number or an error. Auto-detected, no toggle.
  • Payroll decimal hours. A 7h 30m shift is displayed as both 7h 30m and 7.50 hours - ready to paste into timesheets or billing software.
  • Break deduction. Enter unpaid breaks in minutes and the calculator subtracts them from every metric at once.
  • Unified time and date modes. No need to find a second calculator for date math.
  • Business-day counting. Weekends excluded automatically. Handles year boundaries, leap years, and month lengths correctly.
  • Include-end-day toggle. Answers both interpretations of how many days from Monday to Friday - 4 (exclusive) or 5 (inclusive).
  • Add or subtract durations. Stack multiple times together for a total, or subtract one from another. Both operations have dedicated buttons.
  • Dynamic rows. Add up to 12 durations in a single calculation. Remove any middle row without disturbing the others.
  • Full breakdown. Date mode shows years, months, weeks, days, hours, minutes, and seconds - plus a proportional bar chart.

How the Calculation Works

Duration is the difference between two points in time. Three formulas cover every mode:

Time mode: Duration = (End - Start) mod 24h - Break
Date mode: Duration = End - Start +/- EndDay - Weekends (optional)
Add/Sub: Result = Row1 + Row2 + ... OR Row1 - (Row2 + Row3 + ...)

Step-by-Step Logic

StepWhat happens
1Both inputs are converted to seconds since midnight (time mode) or milliseconds since the Unix epoch (date mode).
2End is subtracted from Start. If the result is negative in time mode, 24 hours is added to handle overnight shifts.
3Break time (if any) is converted from minutes to seconds and subtracted.
4In date mode, the end-day offset and weekend exclusion are applied before any unit conversion.
5In add/subtract mode, each row is converted to total seconds first, then combined according to the selected operation.
6The remaining seconds are decomposed into every useful unit: years, months, weeks, days, hours, minutes, and seconds.

Unit Conversions Used

UnitEquivalent
1 minute60 seconds
1 hour60 minutes, 3,600 seconds
1 day24 hours, 1,440 minutes, 86,400 seconds
1 week7 days, 168 hours
1 month (avg)30.4375 days, 730.5 hours (Gregorian average)
1 year (avg)365.25 days, 8,766 hours (includes leap years)

Worked Examples

Example 1 - Standard work shift with lunch break

Clock in at 08:45, clock out at 17:30, take a 45-minute unpaid lunch.

StepValue
Raw gap (08:45 to 17:30)8 h 45 m
Minus 45-minute break8 h 00 m
Decimal hours (payroll)8.00 hours
Total minutes480 minutes

Example 2 - Overnight shift

Shift starts at 22:15 and ends at 06:45 next morning, with a 30-minute break.

StepValue
Raw gap (22:15 to 06:45 rolled over)8 h 30 m
Minus 30-minute break8 h 00 m
Decimal hours8.00 hours

Example 3 - Project deadline in business days

Start date 1 March 2026, end date 31 March 2026, business days only.

MetricValue
Calendar days30 days
Business days (Mon-Fri)22 days
Weekend days8 days

Example 4 - Adding durations (timesheet total)

Three tasks in a day: 2h 30m, 1h 45m 30s, and 3h 15m.

RowValueRunning total
12 h 30 m 0 s2 h 30 m 0 s
21 h 45 m 30 s4 h 15 m 30 s
33 h 15 m 0 s7 h 30 m 30 s
Decimal hours7.51 hours (7 h 30 m 30 s = 7.5083)

Example 5 - Subtracting durations

You have 10 hours to complete three planned tasks (3h 20m, 2h 45m, and 1h 30m). How much time is left?

OperationValue
Row 1 (available)10 h 0 m 0 s
Row 23 h 20 m 0 s
Row 32 h 45 m 0 s
Row 41 h 30 m 0 s
Result (10 minus 7h 35m)2 h 25 m 0 s

Common Duration Conversions

DurationDecimal HoursMinutesCommon use
0 h 15 m0.2515Quarter-hour billing
0 h 30 m0.5030Half-hour
0 h 45 m0.7545Three-quarter hour
1 h 00 m1.0060Standard hour
7 h 30 m7.50450Typical workday
8 h 00 m8.00480Full shift
12 h 00 m12.00720Half-day (24h format)
24 h 00 m24.001,440One full day

Practical Tips

  • For payroll: use the decimal-hours metric - it is what most timesheet software expects. Multiplying by an hourly rate gives gross pay without manual conversion.
  • For shift planning: overnight detection means you never need to add a day manually. Enter the actual clock times.
  • For deadlines: use business days to skip weekends. Add holidays manually - this calculator does not include a public-holiday calendar.
  • For days between questions: decide whether you want exclusive or inclusive counting before you read the result. Both are available via the toggle.
  • For timesheet aggregation: use Add mode. Stack every task or project entry as a separate row and read the decimal hours total directly.
  • For planning and buffers: use Subtract mode. Enter the total available time in row 1, then subtract each planned block to see what is left.
  • For time zones: this tool operates in a single time zone. If your start and end times are in different zones, convert both to a common reference first.

Frequently Asked Questions

What is the difference between the three tabs?

Times measures gaps within a single 24-hour window and auto-handles overnight shifts. Dates measures multi-day ranges with full Y/M/W/D/H/M/S breakdowns and optional business-day filtering. Add / Subtract combines or subtracts multiple durations that you enter manually.

How do I calculate an overnight shift correctly?

Enter the actual clock times. If the end time is earlier than the start, the calculator adds 24 hours automatically. No need to convert to a next-day timestamp yourself.

How does subtract mode decide what to subtract?

The first row is the base amount. Every row after it is subtracted from that base. So if row 1 is 10h and rows 2 and 3 are 2h each, the result is 10 minus 2 minus 2 = 6 hours.

What happens if the subtraction result is negative?

The result is shown with a minus sign and all metrics reflect the negative value. This is useful for calculating deficits - for example, how much a task overran its budget.

How many durations can I add or subtract at once?

Up to 12 rows in a single calculation. This covers virtually every timesheet, workout log, or project-tracking scenario.

Does this handle daylight saving time?

Time mode operates in local clock time - DST transitions on the same day are not adjusted, because clock time and elapsed physical time can differ by one hour on transition days. Date mode uses calendar dates, which are unaffected by DST.

Why is the month/year breakdown approximate?

Months and years have variable lengths. The breakdown uses the Gregorian average (30.4375 days per month, 365.25 days per year) so the total is distributed evenly. For exact calendar differences, count month boundaries manually.

Does the business-day count exclude holidays?

No. It excludes Saturdays and Sundays only. Public holidays vary by country and region, so add them manually to your final count for accurate deadlines.

Can I subtract duration instead of adding it?

Yes. Switch to Subtract Times using the toggle at the top of the Add / Subtract panel. Row 1 is treated as the starting amount, and every row after it is subtracted.

References & Methodology

  1. ISO 8601. Date and time format standard. International Organization for Standardization.
  2. Gregorian Calendar. Mean month and year length conventions used by astronomical and financial systems.
  3. NIST. Time and Frequency Division - SI second definition. National Institute of Standards and Technology.
  4. International Bureau of Weights and Measures (BIPM). SI Brochure, 9th edition, 2019.
  5. Python Software Foundation. datetime module documentation - reference implementation for date arithmetic.
© 2026 all rights reserved
ComfortSkillz Blog