Date Calc
date_calcDate 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. Price: $0.002 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | diff, add, subtract, info or tz | |
| to | No | diff: end date YYYY-MM-DD | |
| asOf | No | info: the date the age is counted to, default today (UTC) | |
| date | No | add, subtract, info: date YYYY-MM-DD | |
| from | No | diff: start date YYYY-MM-DD; tz: local date-time YYYY-MM-DDTHH:MM | |
| unit | No | add, subtract: years, months, weeks, days (default), hours or minutes | |
| amount | No | add, subtract: whole number | |
| to_zone | No | tz: IANA zone to show, e.g. America/New_York | |
| datetime | No | tz: local date-time like 2026-10-15T09:30 | |
| birthDate | No | info: date of birth YYYY-MM-DD, for the age | |
| from_zone | No | tz: IANA zone of the given time, e.g. Europe/Berlin |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | No | ||
| to | No | ||
| days | No | ||
| from | No | ||
| years | No | ||
| months | No | ||
| source | No | ||
| checkedAt | No | ||
| direction | No | ||
| totalDays | No | ||
| totalHours | No | ||
| totalWeeks | No |