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.
Add two or more durations together. Useful for totalling timesheets, workout logs, or project hours.
How to Use This Calculator
- 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.
- Enter your values. Use the native time and date pickers, or type directly. Both formats accept HH:MM and YYYY-MM-DD.
- Add options if relevant. Subtract unpaid break time from shifts, count only business days for deadlines, or include the end day for inclusive ranges.
- Click Calculate Duration. Every relevant unit is computed at once - including payroll-ready decimal hours.
- 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:
Step-by-Step Logic
| Step | What happens |
|---|---|
| 1 | Both inputs are converted to seconds since midnight (time mode) or milliseconds since the Unix epoch (date mode). |
| 2 | End is subtracted from Start. If the result is negative in time mode, 24 hours is added to handle overnight shifts. |
| 3 | Break time (if any) is converted from minutes to seconds and subtracted. |
| 4 | In date mode, the end-day offset and weekend exclusion are applied before any unit conversion. |
| 5 | In add/subtract mode, each row is converted to total seconds first, then combined according to the selected operation. |
| 6 | The remaining seconds are decomposed into every useful unit: years, months, weeks, days, hours, minutes, and seconds. |
Unit Conversions Used
| Unit | Equivalent |
|---|---|
| 1 minute | 60 seconds |
| 1 hour | 60 minutes, 3,600 seconds |
| 1 day | 24 hours, 1,440 minutes, 86,400 seconds |
| 1 week | 7 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.
| Step | Value |
|---|---|
| Raw gap (08:45 to 17:30) | 8 h 45 m |
| Minus 45-minute break | 8 h 00 m |
| Decimal hours (payroll) | 8.00 hours |
| Total minutes | 480 minutes |
Example 2 - Overnight shift
Shift starts at 22:15 and ends at 06:45 next morning, with a 30-minute break.
| Step | Value |
|---|---|
| Raw gap (22:15 to 06:45 rolled over) | 8 h 30 m |
| Minus 30-minute break | 8 h 00 m |
| Decimal hours | 8.00 hours |
Example 3 - Project deadline in business days
Start date 1 March 2026, end date 31 March 2026, business days only.
| Metric | Value |
|---|---|
| Calendar days | 30 days |
| Business days (Mon-Fri) | 22 days |
| Weekend days | 8 days |
Example 4 - Adding durations (timesheet total)
Three tasks in a day: 2h 30m, 1h 45m 30s, and 3h 15m.
| Row | Value | Running total |
|---|---|---|
| 1 | 2 h 30 m 0 s | 2 h 30 m 0 s |
| 2 | 1 h 45 m 30 s | 4 h 15 m 30 s |
| 3 | 3 h 15 m 0 s | 7 h 30 m 30 s |
| Decimal hours | 7.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?
| Operation | Value |
|---|---|
| Row 1 (available) | 10 h 0 m 0 s |
| Row 2 | 3 h 20 m 0 s |
| Row 3 | 2 h 45 m 0 s |
| Row 4 | 1 h 30 m 0 s |
| Result (10 minus 7h 35m) | 2 h 25 m 0 s |
Common Duration Conversions
| Duration | Decimal Hours | Minutes | Common use |
|---|---|---|---|
| 0 h 15 m | 0.25 | 15 | Quarter-hour billing |
| 0 h 30 m | 0.50 | 30 | Half-hour |
| 0 h 45 m | 0.75 | 45 | Three-quarter hour |
| 1 h 00 m | 1.00 | 60 | Standard hour |
| 7 h 30 m | 7.50 | 450 | Typical workday |
| 8 h 00 m | 8.00 | 480 | Full shift |
| 12 h 00 m | 12.00 | 720 | Half-day (24h format) |
| 24 h 00 m | 24.00 | 1,440 | One 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
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.
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.
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.
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.
Up to 12 rows in a single calculation. This covers virtually every timesheet, workout log, or project-tracking scenario.
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.
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.
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.
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
- ISO 8601. Date and time format standard. International Organization for Standardization.
- Gregorian Calendar. Mean month and year length conventions used by astronomical and financial systems.
- NIST. Time and Frequency Division - SI second definition. National Institute of Standards and Technology.
- International Bureau of Weights and Measures (BIPM). SI Brochure, 9th edition, 2019.
- Python Software Foundation. datetime module documentation - reference implementation for date arithmetic.