skillfed

businesstimedelta

Timedelta for business time. Supports exact amounts of time (hours, seconds), custom schedules, holidays, and time zones.

businesstimedelta v1.0.1 1.4M downloads/30d#3,956 on PyPI38
Permissive license MIT Abandoned released

What it is and what it does

BusinessTimeDelta is a Python library that calculates the elapsed time between two datetimes while respecting business hours, not calendar time. It lets you define working schedules (start/end times, working days), exclude lunch breaks and holidays, and perform arithmetic on business time intervals. The package integrates with pytz for timezone handling and the holidays library for holiday exclusion.

You define your business rules once—specifying work hours, days of the week, lunch breaks, and holidays—then use those rules to compute the actual working time between any two datetimes or to add/subtract business time from a given moment. This is useful for SLAs, ticket response times, project scheduling, and any domain where elapsed time should count only working hours.

Use it for:

  • Calculate SLA compliance: measure working hours elapsed since a support ticket was opened, excluding nights and weekends.
  • Project scheduling: add business days and hours to a start date to estimate a realistic delivery deadline.
  • Multi-timezone overlap: find the working-hour intersection between teams in different time zones.
  • Payroll and shift tracking: compute hours worked across day and night shifts, accounting for lunch breaks.
  • Holiday-aware reporting: exclude company holidays and local holidays from time-tracking calculations.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Calculates elapsed working time between two datetimes, accounting for business hours, lunch breaks, holidays, and time zones.

No—not recommended for new projects. The package is abandoned (last commit 2022-01-26) and will not receive updates. While it has low install friction and a permissive MIT license, the lack of maintenance means you will inherit any compatibility issues and cannot rely on bug fixes. Consider an actively maintained alternative if business time calculation is critical to your application.

Install

businesstimedelta on PyPI

pip

pip install businesstimedelta

uv

uv add businesstimedelta

poetry

poetry add businesstimedelta

Installing businesstimedelta

Before you install

Low install friction with only 2 runtime dependencies (pytz and holidays). However, the package is abandoned—last commit was 2022-01-26—so it will not receive bug fixes or updates.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.

Quickstart

import datetime
import businesstimedelta

workday = businesstimedelta.WorkDayRule(
    start_time=datetime.time(9),
    end_time=datetime.time(18),
    working_days=[0, 1, 2, 3, 4])
businesshrs = businesstimedelta.Rules([workday])

start = datetime.datetime(2016, 1, 18, 9, 0, 0)
end = datetime.datetime(2016, 1, 22, 18, 0, 0)
bdiff = businesshrs.difference(start, end)
print(bdiff.hours)

Verify before relying

  • Whether the package works reliably with modern Python versions despite being abandoned since 2022
  • Active maintenance or community forks that may address compatibility issues

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — pytz, holidays
Maintenance abandoned — 2,533 days since the last release
Last repo commit
First released
Downloads 1,398,661/month — #3,956 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: businesstimedelta-1.0.1-py3-none-any.whl

Keywords: business, working, time, timedelta, hours, businesstime, businesshours

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Office/Business :: Scheduling

Tags

business hours time calculationworking time between datesbusiness timedeltaexclude weekends holidays from durationcustom work schedule durationtimezone-aware business hoursworkday time arithmetic
time-calculationschedulingabandoned

More Scheduling packages