# agent402.tools Calendar Diff

> agent402.tools Calendar Diff is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Calculates the precise difference between two datetimes broken down into years, months, days, hours, minutes, seconds, and total milliseconds

## Facts

- Endpoint: GET https://agent402.tools/api/calendar-diff
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-calendar-diff-4bcfd685
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_SdfIcVsSXNlN3f3Pxkn_k

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 agent402-tools-calendar-diff-4bcfd685
```

Example prompt: How much time has passed between January 15, 2024 and June 23, 2026 — give me the breakdown in years, months, days, hours, and minutes?

## When to prefer this

Use this endpoint when you need a precise, multi-unit decomposition of the time difference between two specific datetimes (years + months + days + hours + minutes + seconds + milliseconds), especially when the inputs may be in mixed formats like ISO 8601, Unix timestamps, or natural language date strings. Prefer this over simple subtraction when a human-readable breakdown across calendar units is needed.

## Known failure modes

- Missing 'from' or 'to' query parameter returns an error
- Unparseable date string (not ISO 8601, Unix timestamp, or natural date) returns a parse error
- 'from' date later than 'to' date may return negative values or an error
- Ambiguous natural date strings may be misinterpreted
- Network timeout or service unavailability

## How this service works

Calculate the precise difference between two datetimes in years, months, days, hours, minutes, seconds, and total milliseconds. Accepts ISO 8601, Unix timestamps, or natural date strings. ?from=2024-01-15&to=2026-06-23.

## Output

A structured breakdown of the difference between the two datetimes expressed in years, months, days, hours, minutes, seconds, and total milliseconds

## 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": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "End datetime"
      },
      "from": {
       "type": "string",
       "description": "Start datetime"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": "2026-06-23T00:00:00.000Z",
  "diff": {
   "days": 8,
   "hours": 0,
   "years": 2,
   "months": 5,
   "minutes": 0,
   "seconds": 0
  },
  "from": "2024-01-15T00:00:00.000Z",
  "total": {
   "days": 890,
   "hours": 21360,
   "minutes": 1281600,
   "seconds": 76896000,
   "milliseconds": 76896000000
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-calendar-diff-4bcfd685/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
