{"slug":"api-sitecheck-api-workers-dev-api-date-calc-f3c28a","title":"Date and time calculations in pure code","host":"api.sitecheck-api.workers.dev","method":"GET","resource":"https://api.sitecheck-api.workers.dev/api/date/calc","category":"code","description":"Date and time calculations in pure code. op=diff: calendar years, months and days between two dates, and the total days. op=add or subtract: move a date by years, months, weeks, days, hours or minutes (month ends are clamped). op=info: weekday, ISO week, day of year, quarter, and age from birthDate.","price_listed":0.001,"price_asked":0.001,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":32,"reported_calls_30d":2,"reported_payers_30d":2,"networks":["eip155:5042","eip155:8453","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"method":"GET","queryParams":{"from":"2000-02-29","op":"diff","to":"2026-10-15"},"type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"method":{"enum":["GET"],"type":"string"},"queryParams":{"properties":{"amount":{"description":"add, subtract: whole number","type":"string"},"asOf":{"description":"info: the date the age is counted to, default today (UTC)","type":"string"},"birthDate":{"description":"info: date of birth YYYY-MM-DD, for the age","type":"string"},"date":{"description":"add, subtract, info: date YYYY-MM-DD","type":"string"},"datetime":{"description":"tz: local date-time like 2026-10-15T09:30","type":"string"},"from":{"description":"diff: start date YYYY-MM-DD; tz: local date-time YYYY-MM-DDTHH:MM","type":"string"},"from_zone":{"description":"tz: IANA zone of the given time, e.g. Europe/Berlin","type":"string"},"op":{"description":"diff, add, subtract, info or tz","type":"string"},"to":{"description":"diff: end date YYYY-MM-DD","type":"string"},"to_zone":{"description":"tz: IANA zone to show, e.g. America/New_York","type":"string"},"unit":{"description":"add, subtract: years, months, weeks, days (default), hours or minutes","type":"string"}},"required":["op"],"type":"object"},"type":{"const":"http","type":"string"}},"required":["type","method"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-10-18","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.001,"price_match":true,"latency_ms":32,"error":null}],"description_full":"Date and time calculations in pure code. op=diff: calendar years, months and days between two dates, and the total days. op=add or subtract: move a date by years, months, weeks, days, hours or minutes (month ends are clamped). op=info: weekday, ISO week, day of year, quarter, and age from birthDate. op=tz: a local date-time in one IANA time zone shown in another. Impossible dates are a 400 with the reason.","last_updated":"2026-10-15T19:49:05.645Z","schemes":["exact"]}