# Toolbelt402 Time Math

> Toolbelt402 Time Math is a paid API for AI agents from toolbelt402.tpoborne.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Performs date/time arithmetic: computes the difference between two datetimes, adds or subtracts ISO-8601 durations from a start time, or converts a timestamp to any IANA timezone with UTC offset and weekday.

## Facts

- Endpoint: GET https://toolbelt402.tpoborne.workers.dev/time/math
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toolbelt402-time-math-f33eb8e0
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GzPwoIGp0UQIp5Xxgymhc

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 toolbelt402-time-math-f33eb8e0
```

Example prompt: How many days and hours are between 2024-03-15T09:00:00Z and 2024-11-28T17:30:00Z? Use the diff operation.

## When to prefer this

Choose this endpoint when you need precise, server-side date/time arithmetic without relying on client-side libraries — especially for ISO-8601 duration math, timezone-aware conversions with correct UTC offsets and DST handling, or computing exact differences between two timestamps. Prefer it over general-purpose code execution when you want a lightweight, deterministic, single-call result for time operations.

## Known failure modes

- Missing required 'op' query parameter returns an error
- Invalid or missing 'from'/'to' for diff operation returns a validation error
- Malformed ISO-8601 duration string for add/subtract returns a parse error
- Unrecognized IANA timezone string for convert operation returns an error
- Missing 'time' or 'tz' parameter for convert operation returns an error

## How this service works

Date and time arithmetic done right: difference between two datetimes, add or subtract ISO-8601 durations, convert an instant into any IANA timezone with UTC offset and weekday.

## Output

Returns a JSON object containing the result of the requested time operation: for 'diff', the duration between two datetimes (days, hours, minutes, seconds); for 'add'/'subtract', the resulting datetime after applying the ISO-8601 duration; for 'convert', the input instant expressed in the target IANA timezone including UTC offset and weekday name.

## 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": [
      "op"
     ],
     "properties": {
      "op": {
       "enum": [
        "diff",
        "add",
        "subtract",
        "convert"
       ],
       "type": "string",
       "description": "diff needs from+to; add/subtract need start+duration (ISO-8601, e.g. P1DT2H30M); convert needs time+tz"
      },
      "to": {
       "type": "string"
      },
      "tz": {
       "type": "string",
       "description": "IANA timezone, e.g. Europe/London"
      },
      "from": {
       "type": "string"
      },
      "time": {
       "type": "string"
      },
      "start": {
       "type": "string"
      },
      "duration": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toolbelt402-time-math-f33eb8e0/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolbelt402.tpoborne.workers.dev](https://www.zero.xyz/host/toolbelt402.tpoborne.workers.dev/llms.txt)
