how to calculate business hours between two datetimes across time zones and daylight saving time
Calculating business hours between two datetimes when participants are in different time zones and daylight saving time (DST) may be tricky. This guide explains what the calculation is, why DST and time zones matter, the step-by-step formula and method to do it manually, worked examples (including a DST transition), common mistakes and how to use an online calculator to speed up the process.
what this calculation is and when to use it
This calculation finds the total number of work (business) hours that fall between two specific timestamps, using a defined daily work schedule (for example, 09:00–17:00 local time). Use it to estimate billable hours, measure team availability across regions, arrange meetings within overlapping office hours, or compute SLA coverage across time zones and DST changes.
main idea and formula
Core idea: convert both timestamps to the same reference (usually UTC), then for each local workday compute the overlap between that day's work window (in UTC) and the time window between the two timestamps. Sum overlaps across all days in the range.
High-level formula (conceptual):
Total business hours = sum_over_each_local_day( overlap( [start_utc, end_utc], [work_start_utc(day), work_end_utc(day)] ) )
Where overlap(A,B) is the duration (hours) common to intervals A and B, and work_start_utc(day) is the daily work start converted to UTC accounting for that day's offset (including DST).
step-by-step method to calculate manually
- Define parameters: start datetime and end datetime with their time zones; workday hours in each location (e.g., 09:00–17:00 local); which location's business hours you want to count (choose one office or compute overlap for multiple offices).
- Normalize to UTC: convert both start and end datetimes to UTC. Use the correct UTC offset for each date because DST can change offsets on specific days.
- Iterate by local calendar day: for each calendar day in the local office's timezone between start and end (inclusive), compute that day's work window expressed in UTC. Important: the UTC offset for that local day may change if DST starts/ends that day.
- Compute daily overlap: for each day, calculate the overlap between [start_utc, end_utc] and [work_start_utc(day), work_end_utc(day)]. If overlap ≤ 0, contribution is 0.
- Sum overlaps: add all daily overlaps to get total business hours (in hours or minutes).
- Round as needed: present result in hours and minutes, or decimal hours depending on requirements.
detailed notes on DST and offsets
- DST changes the local clock, not UTC. On the DST start day in many regions clocks jump forward (e.g., from 02:00 to 03:00), shortening the local day by one hour. On DST end they fall back an hour, lengthening the local day.
- When converting a local work interval to UTC for that calendar day, use the local UTC offset that is valid during the work hours. If the work window crosses the instant of DST change, split the day into sub-intervals with different offsets.
- Always consult a reliable timezone database (IANA tz) or timezone-aware tools when converting timestamps across DST boundaries.
worked example 1 — simple same-day overlap (no DST)
Parameters:
- Office timezone: Europe/London (assume UTC+0 for this date)
- Work hours: 09:00–17:00 local
- Start: 2026-10-12 12:30 America/New_York (EDT, UTC-4)
- End: 2026-10-12 16:00 America/New_York (EDT, UTC-4)
Steps:
- Convert start/end to UTC: start = 16:30 UTC, end = 20:00 UTC.
- Convert London's work window (09:00–17:00 local) to UTC: 09:00 UTC–17:00 UTC (no offset change on this date).
- Overlap between [16:30,20:00] and [09:00,17:00] is from 16:30 to 17:00 = 0.5 hours (30 minutes).
Result: 0.5 business hours.
worked example 2 — multi-day range with full and partial days
Parameters:
- Office timezone: America/Los_Angeles (work 08:30–17:30 local)
- Start: 2026-11-02 15:00 UTC
- End: 2026-11-05 04:00 UTC
Assume Los Angeles is UTC-7 on Nov 2 and switches to UTC-8 on Nov 5 at 02:00 local (DST end). Steps:
- List local days in LA covered: 2026-11-02, 11-03, 11-04, 11-05.
- For each local day compute work window in UTC using that day's offset:
- Nov 2 (UTC-7): work 08:30–17:30 local → 15:30–00:30 UTC (same day start 15:30 UTC to next day 00:30 UTC)
- Nov 3 (UTC-7): 15:30–00:30 UTC
- Nov 4 (UTC-7): 15:30–00:30 UTC
- Nov 5: DST ends at 02:00 local; local offset becomes UTC-8. For Nov 5 work window 08:30–17:30 local → with UTC-8 that is 16:30–01:30 UTC
- Nov 2 window 15:30–00:30: overlap with start 15:00 is 15:30–00:30 → 9 hours
- Nov 3 full day window 15:30–00:30 → 9 hours
- Nov 4 full day window 15:30–00:30 → 9 hours
- Nov 5 window 16:30–01:30: end is 04:00 UTC, so overlap is 16:30–01:30 but clipped to end 04:00 → actually no overlap because 16:30 UTC (Nov 5) is after 04:00 UTC (Nov 5). So 0 hours.
Total business hours = 9 + 9 + 9 + 0 = 27 hours.
worked example 3 — DST transition during work hours (split the day)
Parameters:
- Office timezone: Europe/Berlin (work 09:00–17:00 local)
- DST starts on that date at 02:00 local (clocks move forward to 03:00), making that date one hour shorter.
- Start: 2026-03-29 00:00 Europe/Berlin local
- End: 2026-03-29 23:59 Europe/Berlin local
Steps:
- On DST start day, local offset before 02:00 is UTC+1; after 03:00 becomes UTC+2.
- The work window 09:00–17:00 local falls entirely after the DST switch, so use UTC+2: convert to 07:00–15:00 UTC.
- Overlap with the full-day range is the full work window: 8 hours. Although the calendar day was shortened by 1 hour, work hours still occupy 8 real hours because the clock change occurred earlier.
Key point: if the work window crosses the instant of DST change (e.g., work 01:00–05:00 on the switch day), split into before/after segments using the correct offsets.
common mistakes and how to avoid them
- Assuming a constant UTC offset for all days — wrong when DST changes inside the range. Always check offsets per day.
- Forgetting to convert work hours to UTC for each day — leads to incorrect overlap calculations.
- Not splitting a work window that crosses a DST instant — results in off-by-one-hour errors.
- Using local calendar day iteration from the wrong timezone (use the office timezone whose business hours you intend to measure).
how to compute overlap duration (practical formula)
Given two intervals A = [a_start, a_end] and B = [b_start, b_end] (UTC timestamps), the overlap duration in hours is:
overlap_hours = max(0, min(a_end, b_end) - max(a_start, b_start)) / 3600
Apply this daily where A is the global [start_utc, end_utc] and B is that day's work window in UTC.
how to use an online calculator
Manual calculations are error-prone around DST. Use a timezone-aware business-hours calculator on Calculatorr to speed up and avoid mistakes. Steps:
- Open the business hours between datetimes calculator on https://calculatorr.com/ (search for 'business hours between datetimes').
- Enter start datetime with its timezone and end datetime with its timezone.
- Set the office timezone whose business hours you want to measure and define daily start/end times and working weekdays.
- The tool will apply correct timezone offsets per date (including DST) and return total business hours, plus a day-by-day breakdown.
presentation and rounding
Decide whether to show results as hours and minutes (e.g., 27h 30m), decimal hours (27.5 h) or minutes. For billing, round according to your policy: nearest 5, 6, 15 minutes or by exact minutes.
summary of practical checklist
- Confirm which office timezone's business hours you measure.
- Use accurate timezone data (IANA tz names) and correct offsets per date.
- Convert timestamps to UTC for interval math, or use a timezone-aware library.
- Split days if the work window crosses a DST instant.
- Sum daily overlaps and present in the required unit.
Calculations like these are easy to implement in code using timezone libraries (pytz or zoneinfo in Python, luxon/date-fns-tz in JavaScript). If you need a quick result without coding, use the calculator on Calculatorr to handle DST and time zone complexity automatically.
example quick reference (cheat sheet)
| Step | Action |
|---|---|
| 1 | Choose office timezone and work hours |
| 2 | Convert start/end to UTC |
| 3 | For each local day, convert work window to UTC (consider DST) |
| 4 | Compute overlap per day using overlap = max(0,min(end,a_end)-max(start,a_start)) |
| 5 | Sum overlaps and round |
If you want, test your cases with the Calculatorr business-hours tool to check manual results and avoid DST pitfalls.