pydit.wrangling.date_time_calculations.business_calendar

class pydit.wrangling.date_time_calculations.business_calendar(start_date=None, end_date=None, bus_start_time=9, bus_end_time=17)[source]

Bases: object

Class to calculate the business hours between datetimes

Parameters:
  • start_date (date, optional) – start date of the business calendar, by default 1st Jan 2010

  • end_date (date, optional) – end date of the business calendar, by default one year from current date

  • bus_start_time (int, optional) – start time of the business day, defaults to 9 (9am)

  • bus_end_time (int, optional) – end time of the business day, defaults to 17 (5pm)

Return type:

object with methods to calculate business hours and minutes between two datetimes

Methods

business_hours

Calculate the number of business hours between two datetimes.

business_mins

Calculate the business minutes between two datetimes

business_hours(datetime_start, datetime_end)[source]

Calculate the number of business hours between two datetimes.

business_mins(datetime_start, datetime_end)[source]

Calculate the business minutes between two datetimes