gs_quant.datetime.date.business_day_count¶
- business_day_count(begin_dates, end_dates, calendars=(), week_mask=None)[source]¶
Determine the number of business days between begin_dates and end_dates
- Parameters:
begin_dates (
Union[date,Iterable[date]]) – A date or collection of beginning datesend_dates (
Union[date,Iterable[date]]) – A date or collection of end datescalendars (
Union[str,Tuple[str,...]]) – Calendars to use for holidaysweek_mask (
Optional[str]) – Which days are considered weekends (defaults to Saturday and Sunday)
- Return type:
Union[int,Tuple[int]]- Returns:
An int or tuple of ints, representing the number of business days between begin_dates and end_dates
Examples
>>> import datetime as dt >>> today = dt.date.today() >>> bus_days = business_day_count(today, today + dt.timedelta(days=7))