Business days and holiday API guide
Calculate elapsed time, differences, business days, and holiday-aware calendar results.
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, with calendar projection available from /v1/time/calendar. Add business_days=true to request a business-day count and pair it with holiday_country when public holidays should be excluded. This supports working days, add business days, and diff business days calculations without rebuilding holiday calendars in your application.
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"
Request model
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:
GET /v1/time/diff?from=iso=2026-01-02T00:00:00Z&to=iso=2026-04-30T00:00:00Z&business_days=true&holiday_country=US
holiday_country uses an ISO 3166-1 alpha-2 code. Add holiday_subdivision only when the selected calendar supports that subdivision. Both holiday parameters require business_days=true; unsupported or malformed calendars return a documented INVALID_PARAMETER error.
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.
- Use Add to a timestamp for ordinary day, hour, minute, or second date arithmetic. It is not a holiday-aware business-day adder.
Read diff and business days, the diff endpoint reference, and the elapsed endpoint reference.
