Skip to content

Business days and holiday API guide: count working days between dates

Count business days between two dates, skipping weekends and public holidays for 249 countries and 862 regional calendars, in one API request.

Updated

Short answer: call /v1/time/diff (or /v1/time/elapsed) with business_days=true and a holiday_country. You get a working-day count that skips weekends and that country's public holidays, for any of 249 countries and 862 calendars including regional subdivisions.

curl "https://api.timelogicapi.com/v1/time/diff?from=iso=2026-01-02T00:00:00Z&to=iso=2026-04-30T00:00:00Z&business_days=true&holiday_country=US" \
  -H "Authorization: Bearer $TIMELOGIC_API_KEY"

How do business-day calculations work?

TimeLogic API exposes a holiday API and business day calculator API through /v1/time/diff and /v1/time/elapsed. Add business_days=true to request a business-day count between two instants and pair it with holiday_country when public holidays should be excluded. This covers working-day counts between two dates (the classic working days API and count business days API use case) without rebuilding holiday calendars in your application. /v1/time/calendar has no business-day or holiday parameters, and there is no "add N business days" operation.

Days are counted by calendar date with the start date included and the end date excluded, so the example above counts January 2 through April 29. When a timezone is known for an endpoint (for example from_tz), its date is taken in that zone; otherwise in UTC.

What does the request look like?

from and to are embedded specifiers such as now, unix=..., or iso=.... For local ISO wall times, add the matching from_tz, to_tz, or another source hint. Then enable business-day mode (diff business days API):

GET /v1/time/diff?from=iso=2026-01-02T00:00:00Z&to=iso=2026-04-30T00:00:00Z&business_days=true&holiday_country=US

Which holiday calendars are supported?

holiday_country takes any of the 249 countries with holiday calendars (862 calendars including subdivisions), as an ISO 3166-1 alpha-2 code in any letter case. Add holiday_subdivision for a regional calendar (for example GB + ENG, CH + ZH, IN + MH, NZ + CAN), or use the combined form holiday_country=CH-ZH. Subdivision codes can contain digits, and leading zeros count (FI-01, FR-971, FR-6AE). Weekends follow each country's working week, for example Friday and Saturday in SA. Holiday data covers 1900 to 2100. The full list with every subdivision code is in holiday calendars. Both holiday parameters require business_days=true; unsupported or malformed calendars return a documented INVALID_PARAMETER error.

Results for the same range, January 2 to April 30, 2026 (from=iso=2026-01-02T00:00:00Z&to=iso=2026-04-30T00:00:00Z&business_days=true), show what each public holidays API calendar changes:

Calendarbusiness_days
holiday_country=FR83
holiday_country=FR-6AE (Alsace: Good Friday is a holiday)82
holiday_country=FR&holiday_subdivision=971 (Guadeloupe)81
holiday_country=CH&holiday_subdivision=ZH (Zürich)82
holiday_country=IN-MH (Maharashtra)76
holiday_country=NZ-CAN (Canterbury)79
holiday_country=SA (Friday–Saturday weekend)79

Which operation should I use?

  • Use Diff between two moments when both endpoints are known and you need elapsed duration plus an optional business-day count.
  • Use Elapsed since when one reference is compared with the current request time, or with an optional comparison timestamp.
  • Use Calendar projection when you need year, month, day, weekday, or ISO week fields for a resolved instant (no business-day data).
  • Use Add to a timestamp for ordinary day, hour, minute, or second date arithmetic. It is not a holiday-aware business-day adder.

Related guides and documentation

Frequently asked questions

How do I count business days between two dates?

Call /v1/time/diff with from and to (for example from=iso=2026-01-02T00:00:00Z&to=iso=2026-04-30T00:00:00Z), business_days=true and holiday_country set to an ISO country code such as US. The response includes the business-day count alongside the elapsed duration.

Which countries have holiday calendars?

249 countries, with 862 calendars in all once regional subdivisions are included, such as US states, Swiss cantons, Indian states and Italian provinces. Holiday data covers 1900 to 2100. The full list of codes is in the holiday calendars documentation.

Are the start and end dates included in the count?

Days are counted by calendar date with the start date included and the end date excluded. When a timezone is known for an endpoint, such as from_tz, its date is taken in that zone; otherwise in UTC.

Which days count as the weekend?

Weekends follow each country's working week. For example, Saudi Arabia (SA) uses a Friday and Saturday weekend.

Can the API add N business days to a date?

No. There is no add-business-days operation. /v1/time/add performs ordinary day, hour, minute or second arithmetic and is not holiday-aware.