# Date Math Business Hours Calculator

> Date Math Business Hours Calculator is a paid API for AI agents from date-math.datemath.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-21).

Calculates SLA deadlines N business hours after a start time, or measures elapsed business time between two timestamps, with custom work schedules, holidays, and DST awareness.

## Facts

- Endpoint: POST https://date-math.datemath.workers.dev/v1/business_hours?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/date-math-business-hours-calculator-396a4411
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V-RMjWjqU4StduMHQVC1e

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability date-math-business-hours-calculator-396a4411 -d '<json body>'
```

Example prompt: If a support ticket is opened on Friday November 7th 2025 at 4pm Manila time, when is the deadline for an 8 business-hour SLA response? Use standard 9am–5pm weekdays, exclude Philippine public holidays, and give me the answer in Asia/Manila time.

## When to prefer this

Use this endpoint when you need precise business-hours arithmetic — finding an SLA deadline N working hours ahead, or measuring working time between two events — especially when the calculation must respect country-specific public holidays (207 countries), custom work schedules (non-standard hours or weekend-inclusive workdays), and DST-safe timezone handling. Prefer this over generic date-addition endpoints when the distinction between calendar time and business time matters, or when compliance with regional holidays is required.

## Known failure modes

- Invalid or unrecognized IANA timezone string returns an error
- Country code not matching ISO 3166-1 alpha-2 pattern causes validation failure
- Start or end datetime string not parseable as ISO 8601 or local datetime returns parse error
- Hours value exceeding maximum of 2000 or negative values rejected
- Work start and end times not matching HH:MM pattern cause schema validation failure
- Date range exceeding one year for elapsed mode rejected
- Ambiguous local datetimes during DST transitions may require explicit UTC offset

## How this service works

Date Math: SLA math in working hours: the deadline N business hours after a start time, or business time elapsed between two times. Use for support-ticket SLAs, response-time targets and office-hours deadlines. Custom hours and workdays, holidays, country public holidays, DST-aware.

## Output

Returns a JSON object containing the computed deadline datetime with timezone offset, the same deadline in UTC, the number of business minutes involved, the starting weekday, the input timezone, and a mode indicator ('deadline' or 'elapsed') clarifying which calculation was performed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "end": {
   "type": "string",
   "description": "Count business time from start to end (max 1 year)"
  },
  "hours": {
   "type": "number",
   "maximum": 2000,
   "minimum": 0
  },
  "start": {
   "type": "string",
   "description": "Local datetime in timezone or ISO 8601 with offset; default now"
  },
  "country": {
   "type": "string",
   "example": "US",
   "pattern": "^[A-Za-z]{2}$",
   "description": "ISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days"
  },
  "minutes": {
   "type": "number",
   "minimum": 0
  },
  "holidays": {
   "type": "array",
   "items": {
    "type": "string"
   }
  },
  "timezone": {
   "type": "string",
   "description": "IANA time zone, e.g. Asia/Manila"
  },
  "work_end": {
   "type": "string",
   "example": "17:00",
   "pattern": "^([01]\\d|2[0-4]):[0-5]\\d$"
  },
  "workdays": {
   "type": "array",
   "items": {
    "type": "integer",
    "maximum": 6,
    "minimum": 0
   },
   "description": "0 = Sunday; default [1,2,3,4,5]"
  },
  "work_start": {
   "type": "string",
   "example": "09:00",
   "pattern": "^([01]\\d|2[0-4]):[0-5]\\d$"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "deadline",
  "start": "2026-11-06T16:00:00+08:00",
  "weekday": "Monday",
  "deadline": "2026-11-09T10:00:00+08:00",
  "timezone": "Asia/Manila",
  "deadline_utc": "2026-11-09T02:00:00Z",
  "business_minutes": 120
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/date-math-business-hours-calculator-396a4411/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from date-math.datemath.workers.dev](https://www.zero.xyz/host/date-math.datemath.workers.dev/llms.txt)
