Tools/datetime/business_days

datetime/business_days

Count business days between two dates, optionally excluding a country's public holidays.

Free / no pricing configured

What it does

Counts the business days (Monday to Friday) between two dates, inclusive of both endpoints, and breaks the span down into business days, weekend days, and holiday days. Pass a country to also exclude its public holidays.

Primary use cases

  • SLA and turnaround calculations in working days.
  • Counting working days in a period for staffing or payroll.
  • Excluding national holidays from a deadline.

Good to know

Both endpoints are counted. country is an ISO 3166-1 alpha-2 code; pass subdivision (ISO 3166-2) for regional holidays. Holiday data matches the holidays namespace. Max span ~20 years. Computed locally.

Parameters

endstringoptional

End date (YYYY-MM-DD or ISO 8601). Defaults to today.

startstringrequired

Start date (YYYY-MM-DD or ISO 8601).

countrystringoptional

Optional ISO 3166-1 alpha-2 country code to exclude public holidays (e.g. US, DE).

subdivisionstringoptional

Optional ISO 3166-2 subdivision code for regional holidays (e.g. CA, NSW).

datetime/business_days — Faro