Date math: durations & business days (paid $0.001)
datemathCalculate date arithmetic: add or subtract ISO-8601 durations, find differences between datetimes, and count or add business days with configurable weekends and holidays.
Instructions
PAID $0.001. Calendar date math. op='add'/'subtract' an ISO-8601 duration (P1Y2M10DT2H30M) to a date; op='diff' two datetimes into chosen units; op='business-add' add business days (configurable weekend + holidays); op='business-diff' count business days between two dates. Without payment returns the x402 challenge; pass x_payment to settle.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | add | subtract | diff | business-add | business-diff | |
| to | No | End datetime for diff/business-diff. | |
| date | No | Base date for add/subtract/business-add (ISO 8601). | |
| days | No | Business days to add (business-add; may be negative). | |
| from | No | Start datetime for diff/business-diff. | |
| units | No | diff units, e.g. ['days','hours']. | |
| weekend | No | Weekend weekdays (1=Mon..7=Sun; default [6,7]). | |
| duration | No | ISO-8601 duration string or object for add/subtract. | |
| holidays | No | ISO dates to skip as holidays. | |
| timezone | No | IANA zone for parsing/rendering. | |
| x_payment | No | x402 payment payload (base64) for this PAID tool. If supplied it is forwarded as the X-PAYMENT header to settle the $0.001 call and return the real result instead of a 402 challenge. Omit to get the price challenge first. |