tmval.bankers_rule

tmval.growth.bankers_rule(beg_dt: datetime.datetime, end_dt: datetime.datetime, frac=True) → float[source]

Calculate the number of days using the Banker’s rule or actual/360 rule. Set frac=True to return days as a percentage of year.

Parameters
  • beg_dt (datetime.datetime) – the beginning date

  • end_dt (datetime.datetime) – the ending date

  • frac (bool, optional) – whether you want the answer in number of days or fraction of a year, defaults to True

Returns

the number of days or percent of a year between two dates using the Banker’s rule or actual/360 rule, depending on frac

Return type

float