{"uid":"cap_V-RMjWjqU4StduMHQVC1e","slug":"date-math-business-hours-calculator-396a4411","name":"Date Math Business Hours Calculator","description":"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.","url":"https://date-math.datemath.workers.dev/v1/business_hours?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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$"}}},"responseSchema":{"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}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_46HMYj9dxCOFQVvOu6OlY","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Support ticket SLA deadline calculation","prompt":"A customer opened a high-priority support ticket today, Monday March 10th 2025 at 2:30pm Eastern US time. When is our 16 business-hour SLA deadline, using standard 9am–5pm Monday through Friday and excluding US public holidays?"},{"title":"Elapsed business time between two events","prompt":"How many business hours elapsed between when our order was placed on Wednesday April 2nd 2025 at 11am and when it shipped on Friday April 4th 2025 at 3pm? Use 8am–6pm weekdays, Asia/Tokyo timezone, and exclude Japanese public holidays."},{"title":"Custom weekend schedule SLA math","prompt":"Our warehouse operates Sunday through Thursday 7am to 4pm. If we received a return request on Thursday March 20th 2025 at 3pm in the US/Central timezone, what is the deadline 24 business hours later, excluding US holidays?"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-21T12:34:44.498Z","isFirstParty":false,"canonicalSlug":"date-math-business-hours-calculator-396a4411"}