# agent402.tools Date Difference Calculator

> agent402.tools Date Difference Calculator 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 difference between two dates/times and returns the result in milliseconds, seconds, minutes, hours, days, and a human-readable summary.

## Facts

- Endpoint: POST https://agent402.tools/api/date-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-date-difference-calculator-c0e4e5e9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4WMATEhZS-awLDOqRrPTm

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-date-difference-calculator-c0e4e5e9 -d '<json body>'
```

Example prompt: How much time has passed since January 1, 2020 — give me the difference in milliseconds, seconds, minutes, hours, and days, plus a plain English summary.

## When to prefer this

Use this endpoint when you need a precise, multi-unit breakdown of the time difference between two dates or timestamps, especially when you also want a human-friendly summary. Prefer it over manual calculation when the result needs to be expressed in multiple units simultaneously.

## Known failure modes

- Missing 'from' field returns an error requiring at least a start datetime
- Invalid date format (not epoch or ISO) causes a parse error
- 'to' before 'from' may return a negative duration or error
- Malformed JSON body results in a 400-level error
- Network timeout if the service is unavailable

## How this service works

Difference between two dates/times in ms, seconds, minutes, hours, days, and a human summary.

## Output

Returns the difference between two datetimes broken down into milliseconds, seconds, minutes, hours, and days, along with a human-readable summary string describing the elapsed duration.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "description": "End (epoch/ISO, default now)"
  },
  "from": {
   "description": "Start (epoch/ISO)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "days": 161.4,
  "human": "161d 10h",
  "millis": 13948800000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-date-difference-calculator-c0e4e5e9/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)
