# x402 Utils – Date Arithmetic & Difference Calculator

> x402 Utils – Date Arithmetic & Difference Calculator is a paid API for AI agents from utils.kagurazaka.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-30).

Add or subtract ISO 8601 durations to a date, or compute the difference between two dates in days, weeks, months, years, seconds, and business days (with country-specific public holidays).

## Facts

- Endpoint: GET https://utils.kagurazaka.dev/v1/date?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-utils-date-arithmetic-difference-calculator-d8790bb7
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9Oge3J4GhAh_i81wnf7z-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-utils-date-arithmetic-difference-calculator-d8790bb7
```

Example prompt: How many business days are there between 2025-03-01 and 2025-06-30 in the US, and what weekday and ISO week number does June 30 fall on?

## When to prefer this

Choose this endpoint when you need precise calendar arithmetic — adding or subtracting ISO 8601 durations with correct month-end clamping, or counting elapsed time between two dates in multiple units including country-specific business days. Prefer it over generic date libraries when you need business-day counting with public holidays for a specific country, or when you need ISO week numbers and weekday metadata alongside the result.

## Known failure modes

- Missing required 'start' parameter returns an error
- Invalid date format (non-ISO 8601) causes a parse error
- Invalid ISO 8601 duration string (e.g. malformed 'P' expression) causes an error
- Unrecognized ISO country code may result in no holiday exclusions or an error
- Both 'add' and 'subtract' specified simultaneously may cause ambiguous behavior

## How this service works

Add or subtract an ISO 8601 duration (P1M, P2W, PT36H) to a date, months clamped to the month's end; or count the days, weeks, calendar months, years, seconds and business days (Monday to Friday, less a country's public holidays) between two dates. Also the weekday, ISO week and day of year.

## Output

A JSON object with a 'start' section (date string, weekday name, ISO week number, and day of year) and optionally a 'between' section (days, weeks, months, years, seconds, and business days between the start and end dates).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "start"
     ],
     "properties": {
      "add": {
       "type": "string",
       "description": "an ISO 8601 duration to add, such as P1M10D"
      },
      "end": {
       "type": "string",
       "description": "a second date, to count the time between"
      },
      "start": {
       "type": "string",
       "description": "a date such as 2026-10-25, or an ISO 8601 time"
      },
      "country": {
       "type": "string",
       "description": "ISO country code whose public holidays are not business days, such as JP"
      },
      "subtract": {
       "type": "string",
       "description": "an ISO 8601 duration to subtract"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "start": {},
      "between": {}
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "start": {
   "date": "2026-10-25",
   "weekday": "Sunday",
   "iso_week": 43
  },
  "between": {
   "days": 61,
   "months": 2,
   "business_days": 42
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-utils-date-arithmetic-difference-calculator-d8790bb7/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from utils.kagurazaka.dev](https://www.zero.xyz/host/utils.kagurazaka.dev/llms.txt)
