BusinessTimeDelta is a small python module I wrote to help you calculate the amount of business time (hours, seconds) between two datetimes. It supports custom schedules, holidays, and time zones.
At PartMyRide we handle a significant volume of orders for body shops and mechanics all over the country. One of our key advantages we provide to our professional customers is a guaranteed delivery date for every order. In order to make good predictions of arrival dates, I needed a way to calculate exactly how much time it takes for an order to be confirmed, fulfilled and shipped by our network of suppliers. Our suppliers are located in different time zones and follow different holiday schedules. No existing python module was suited particularly well for this use case.
A Short Example
First, define a schedule.
Then you can calculate the business time between two datetimes,