{"slug":"date-math-datemath-workers-dev-v1-diff-01d942","title":"Date Math","host":"date-math.datemath.workers.dev","method":"POST","resource":"https://date-math.datemath.workers.dev/v1/diff","category":"other","description":"Date Math: How many days, weeks, months or business days between two dates or datetimes: calendar (Y/M/D), totals, and business days (weekdays in [from, to) minus holidays; pass country to exclude its public holidays). Use for age, tenure, countdowns, notice periods and working days until a deadline","price_listed":0.001,"price_asked":0.001,"state":"answering","state_label":"Answering","checks_7d":7,"answered_7d":7,"latency_ms_median":27,"reported_calls_30d":2,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"country":"US","from":"2026-01-31","to":"2026-03-15"},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"description":"business_days counts working days (default Mon–Fri, see workdays) in [from, to) minus holidays; only for date inputs.","properties":{"country":{"description":"ISO 3166-1 alpha-2 country code (207 countries); its public holidays (2000–2050) are excluded from business days","example":"US","pattern":"^[A-Za-z]{2}$","type":"string"},"from":{"description":"YYYY-MM-DD, or ISO 8601 datetime with Z or offset","example":"2026-11-07T14:30:00Z","type":"string"},"holidays":{"description":"Extra dates excluded from business-day counts (rest days from workdays are always excluded)","items":{"example":"2026-11-07","pattern":"^\\d{4}-\\d{2}-\\d{2}$","type":"string"},"maxItems":1000,"type":"array"},"to":{"description":"YYYY-MM-DD, or ISO 8601 datetime with Z or offset","example":"2026-11-07T14:30:00Z","type":"string"},"workdays":{"description":"Working days of the week, 0 = Sunday. Default [1,2,3,4,5] (Mon–Fri); e.g. [0,1,2,3,4] for Sun–Thu or [1,2,3,4,5,6] for Mon–Sat","example":[1,2,3,4,5],"items":{"maximum":6,"minimum":0,"type":"integer"},"maxItems":7,"minItems":1,"type":"array"}},"required":["from","to"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"properties":{"business_days":{"description":"Weekdays in [from, to) minus holidays (date inputs only)","type":"integer"},"calendar":{"properties":{"days":{"type":"integer"},"months":{"type":"integer"},"years":{"type":"integer"}},"required":["years","months","days"],"type":"object"},"direction":{"enum":["forward","backward"],"type":"string"},"from":{"type":"string"},"iso_duration":{"example":"P1M15D","type":"string"},"to":{"type":"string"},"total_days":{"type":"integer"},"total_hours":{"description":"Datetime inputs only","type":"integer"},"total_minutes":{"type":"integer"},"total_seconds":{"type":"integer"},"total_weeks":{"type":"integer"}},"required":["from","to","direction","total_days","total_weeks","calendar","iso_duration"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-11-26","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":35,"error":null},{"day":"2026-11-25","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":49,"error":null},{"day":"2026-11-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":27,"error":null},{"day":"2026-11-23","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":17,"error":null},{"day":"2026-11-22","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":23,"error":null},{"day":"2026-11-21","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":30,"error":null},{"day":"2026-11-20","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":23,"error":null},{"day":"2026-11-19","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":30,"error":null},{"day":"2026-11-18","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":33,"error":null},{"day":"2026-11-17","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":34,"error":null},{"day":"2026-11-16","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":30,"error":null},{"day":"2026-11-15","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":27,"error":null},{"day":"2026-11-14","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":29,"error":null},{"day":"2026-11-13","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":37,"error":null},{"day":"2026-11-12","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":30,"error":null},{"day":"2026-11-11","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":37,"error":null},{"day":"2026-11-10","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":29,"error":null},{"day":"2026-11-09","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":31,"error":null},{"day":"2026-11-08","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":35,"error":null},{"day":"2026-11-07","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":22,"error":null}],"description_full":"Date Math: How many days, weeks, months or business days between two dates or datetimes: calendar (Y/M/D), totals, and business days (weekdays in [from, to) minus holidays; pass country to exclude its public holidays). Use for age, tenure, countdowns, notice periods and working days until a deadline.","last_updated":"2026-11-09T11:11:07.225Z","schemes":["exact"]}