gs_quant.datetime.date.business_day_offset

business_day_offset(dates, offsets, roll='raise', calendars=(), week_mask=None)[source]

Apply offsets to the dates and move to the nearest business date

Parameters:
  • dates (Union[date, Iterable[date]]) – The input date or dates

  • offsets (Union[int, Iterable[int]]) – The number of days by which to adjust the dates

  • roll (str) – Which direction to roll, in order to get to the nearest business date

  • calendars (Union[str, Tuple[str, ...]]) – Calendars to use for holidays

  • week_mask (Optional[str]) – Which days are considered weekends (defaults to Saturday and Sunday)

Return type:

Union[date, Iterable[date]]

Returns:

A date (if dates is a single date) or tuple of dates, adjusted by the offsets

Examples

>>> import datetime as dt
>>> prev_bus_date = business_day_offset(dt.date.today(), -1, roll='forward')