Time Duration Calculator

Find the exact elapsed time between two date-times using timezone rules.

Date And Time Range

The selected IANA time zone decides daylight saving changes before the elapsed time is counted.

Result

Total minutes120
Total hours2
Total days0.0833
Duration2 hours

Pick a start date and time, an end date and time, and the IANA timezone you want the math to run in. The calculator returns the elapsed span as total minutes, total hours, total days, and a broken-down "X hours, Y minutes" line you can paste into a timesheet or invoice. Because the math anchors both endpoints to UTC instants through the chosen zone, daylight saving transitions are counted correctly: a 01:00 to 04:00 window on a US spring-forward Sunday returns 2 hours, not 3. To compare offsets between two zones rather than measure a single span, use the time difference calculator.

Common use cases

  • Logging a shift on a timesheet. You clocked in at 09:00 and out at 17:30. The calculator returns 8 hours 30 minutes plus 8.5 decimal hours, so you can paste either format into the row your payroll system expects. Decimal hours match Xero, QuickBooks, and most spreadsheet templates without further conversion.
  • Costing a meeting that ran over. A standup booked for 30 minutes ran from 09:55 to 10:45. Enter both endpoints and the result is 50 minutes (0.8333 hours). Multiply that by attendee count and hourly rate to see the cost overrun. For multi-day project totals, pair the count with business days between so you skip weekends.
  • Verifying an overnight shift. A nurse starts at 22:00 on Monday and finishes at 06:00 Tuesday. Set the start and end dates to the actual calendar days. The calculator returns 8 hours and never folds the end time back into the same day, which is the bug most spreadsheet formulas have.
  • Auditing a billable engagement. A consultant logged work from 2026-04-27 09:00 through 2026-04-30 17:00. The calculator returns 80 total hours and a "3 days, 8 hours" breakdown. Use the total hours field for the invoice line and the breakdown for the human-readable summary.

How it works

The calculator interprets each date-and-time pair as a wall-clock value in the IANA zone you select, converts both to UTC instants using `fromZonedTime` from date-fns-tz, and subtracts to get the elapsed milliseconds. The total minutes, hours, and days are derived from that delta; the broken-down "X hours, Y minutes" line comes from `intervalToDuration`. Anchoring through the zone means DST gaps and overlaps are absorbed, so the result reflects real elapsed time rather than the difference of two clock readings.

  1. Enter the start date and time. Pick the calendar date in YYYY-MM-DD form and the wall-clock time in HH:MM (24-hour). The clock value is interpreted in the timezone you choose below, not in your browser zone.
  2. Enter the end date and time. Use the actual end-date for overnight or multi-day spans. For a shift that starts on Monday and ends on Tuesday, enter the Tuesday date in the end field, not the Monday date.
  3. Choose the IANA timezone. Pick the zone the clock readings belong to, such as America/New_York or Europe/Berlin. The same wall-clock window can yield different elapsed totals across DST boundaries, so the zone matters.
  4. Read the four output rows. Total minutes is the integer base. Total hours and total days are the same span re-expressed as decimals. Duration breaks the span into years, months, days, hours, and minutes for human-readable summaries.
  5. Spot-check negative spans. If you swap the start and end by accident, the result flags "End date-time is before the start date-time" and shows a negative total. The duration breakdown is still rendered as an absolute value so you can sanity-check the magnitude.

Worked examples

Standard 9 to 17:30 work day

Start 2026-04-27 09:00, end 2026-04-27 17:30, timezone UTC. A common eight-and-a-half-hour shift with no overnight crossing.

Result: Total minutes 510, total hours 8.5, duration 8 hours, 30 minutes.

The 8.5 decimal hours is the value most payroll spreadsheets want. Round to two decimals for invoices: 8.50.

Across midnight overnight shift

Start 2026-04-27 22:00, end 2026-04-28 06:00, timezone UTC. A typical eight-hour overnight that ends on the next calendar day.

Result: Total minutes 480, total hours 8, duration 8 hours.

You must enter the actual end-date (2026-04-28). Leaving both dates the same would return a negative span and trigger the "end before start" warning.

DST spring-forward window in New York

Start 2026-03-08 01:00, end 2026-03-08 04:00, timezone America/New_York. The clock skips from 02:00 straight to 03:00 that morning.

Result: Total minutes 120, total hours 2, duration 2 hours.

A naive subtraction of 04:00 minus 01:00 returns 3 hours, but only 2 elapsed. The zone-aware math reports the real value.

DST fall-back window in New York

Start 2026-11-01 01:00, end 2026-11-01 03:00, timezone America/New_York. The 01:00 hour repeats that morning.

Result: Total minutes 180, total hours 3, duration 3 hours.

A naive 03:00 minus 01:00 reads 2 hours. Three real hours pass because the 01:00 to 02:00 window is lived through twice.

Multi-day consulting block

Start 2026-04-27 09:00, end 2026-04-30 17:00, timezone UTC. Three full days plus a final partial day.

Result: Total minutes 4800, total hours 80, duration 3 days, 8 hours.

Use the duration breakdown for human reports and the total hours for the invoice. To split the block across working days only, see meeting planner.

Edge cases & gotchas

  • Same start and end returns zero. Entering identical date-time values in both fields returns 0 across every output row. The duration breakdown renders as "0 minutes" rather than an empty string, so a UI that copies the field gets a meaningful token.
  • End before start returns a signed total. If the end is earlier than the start, total minutes, hours, and days come back negative and the result panel shows a warning. The "duration" breakdown still uses absolute values so you can read the magnitude. Swap the inputs to remove the negative sign.
  • DST transitions change real elapsed time. Spring-forward removes a clock hour that nobody lives through; fall-back adds a clock hour that everyone lives through twice. A wall-clock window that spans the transition has either one fewer or one more elapsed hour than the unaware subtraction would suggest. The calculator reports the elapsed value, which is what timesheets and SLAs need.
  • The form takes minute-level inputs only. Clock values are HH:MM (24-hour). Seconds and sub-minute precision are not accepted at the input layer, so a stopwatch reading of 09:00:45 has to be rounded to 09:01 before entering. For epoch-level precision, see the developer epoch tools.

Frequently asked questions about Time Duration Calculator

Does the calculator handle overnight shifts that cross midnight?

Yes. Enter the actual start-date in the start field and the actual end-date in the end field. A 22:00 to 06:00 overnight requires two different calendar dates, and the result is 8 hours.

Why does my 01:00 to 04:00 window only show 2 hours in March?

On the second Sunday in March, US zones skip from 02:00 directly to 03:00. The 02:00 hour does not exist that day, so only two real hours pass between 01:00 and 04:00. The calculator reports elapsed time, not the difference of clock readings.

Why does my 01:00 to 03:00 window show 3 hours in November?

On the first Sunday in November, US zones repeat the 01:00 hour. Two clock readings of 01:00 happen that morning, so three real hours pass between the first 01:00 and 03:00. The calculator counts the lived time.

How do I convert the result to decimal hours for payroll?

The "total hours" row is already the decimal form. 8 hours 30 minutes shows as 8.5. The renderer formats values to four decimal places when they are not whole numbers, so 50 minutes shows as 0.8333.

What happens if I enter the end before the start?

Total minutes, hours, and days come back negative, the panel flags "End date-time is before the start date-time", and the duration breakdown shows the absolute magnitude. Swap the two pairs to flip the sign.

Does the timezone change the answer if both endpoints are in the same zone?

Only across DST boundaries. For a window that does not cross a transition, every IANA zone returns the same elapsed total. For windows that do cross, the chosen zone determines whether an hour is added or removed from the count.

Can I subtract a lunch break from the total?

The form does not take a deduction parameter. Run the calculator twice (morning block and afternoon block) and add the totals, or subtract the lunch minutes manually from the displayed total.

Glossary

IANA timezone
A named region in the IANA tz database, such as America/New_York or Europe/Berlin. The name encodes the full DST and historical-offset rules for that region.
Decimal hours
A duration expressed as a single fractional number of hours. 8 hours 30 minutes is 8.5 decimal hours. Most payroll and accounting systems want this format.
Daylight saving time
The seasonal one-hour shift of local clocks. Spring-forward removes an hour, fall-back adds one. Elapsed time across either boundary differs from the difference of the wall-clock readings.
Wall-clock time
The time a clock on the wall in the chosen zone shows. Wall-clock subtraction does not equal elapsed time across a DST transition; UTC subtraction does.
ISO 8601 duration
The PT8H30M form for an 8.5-hour span. Useful for machine-readable exports. The calculator does not emit ISO 8601 directly, but the duration breakdown maps to it field-by-field.

Related Time Tools