Count business days between dates
count_business_daysUse this when the user asks how many working days, business days or workdays there are between two dates, for example "how many working days between 14 July and 18 August in Germany?", "how many working days are left in December in Ontario?" or "does 16 days of leave cover 5 to 31 December?". Pass the country code, the start and end dates as YYYY-MM-DD, and a region when the user names a state or province. Both dates are counted by default (includeStartDate and includeEndDate change that). Weekends are Saturday and Sunday unless weekendDays is set. Returns the number of business days, calendar days and weekend days, the public holidays that fell on working days, the holidays only some regions keep, and the conventions used. Do not use it for hours, time zones, or date differences that do not exclude weekends and holidays.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | No | State, province or nation within the country, as a subdivision code such as DE-BY or BY (Bavaria), GB-SCT (Scotland), US-CA or AU-NSW. Optional. | |
| country | Yes | Two-letter ISO 3166-1 country code whose holidays apply, such as US, GB, DE, AU or VN. | |
| endDate | Yes | Last date of the range, YYYY-MM-DD. Not before startDate. | |
| startDate | Yes | First date of the range, YYYY-MM-DD. | |
| weekendDays | No | Days of the week that are not working days. Default: saturday and sunday. Use friday and saturday where that is the weekend. | |
| includeEndDate | No | Count endDate when it is a working day. Default true. | |
| includeStartDate | No | Count startDate when it is a working day. Default true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| region | No | ||
| source | Yes | ||
| country | Yes | ||
| endDate | Yes | ||
| weekend | No | ||
| startDate | Yes | ||
| conventions | Yes | ||
| weekendDays | Yes | ||
| businessDays | Yes | ||
| calendarDays | Yes | ||
| includesEndDate | No | ||
| includesStartDate | No | ||
| holidaysOnWorkdays | Yes | ||
| regionalHolidaysNote | No | ||
| regionalHolidaysNotCounted | No |