# Swift Bot Labs Toolbox – Time Difference Calculator

> Swift Bot Labs Toolbox – Time Difference Calculator is a paid API for AI agents from x402-toolbox.swiftbotlab.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-31).

Computes the difference between two timestamps, returning total seconds, days, business days, and a human-readable breakdown (years, months, days).

## Facts

- Endpoint: GET https://x402-toolbox.swiftbotlab.workers.dev/v1/time/diff?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-31
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/swift-bot-labs-toolbox-time-difference-calculator-2b799239
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_E4pw6A4z7kL3YHSO-pnTi

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 swift-bot-labs-toolbox-time-difference-calculator-2b799239
```

Example prompt: How many days and business days are between January 15, 2024 and November 19, 2024? Give me the total seconds, a human-readable breakdown, and the calendar split by years, months, and days.

## When to prefer this

Choose this endpoint when you need a deterministic, pay-per-call time difference computation with no API key setup, especially when you need business-day counts and a human-readable breakdown alongside raw seconds and days. Prefer it over custom date math when you want a reliable, pre-built utility that handles timezone offsets and calendar-aware month/day decomposition.

## Known failure modes

- Missing required 'start' query parameter returns an error
- Malformed or unparseable date string causes a failure response
- Invalid timezone string (tz) may produce incorrect results or an error
- End date before start date may return negative or zero values

## How this service works

62 small, deterministic utility APIs (DNS and e-mail checks, web extraction, EVM decoding, x402 checks, IP math, JSON/CSV, hashing, conversions). No account or API key: pay per call in USDC with x402.

## Output

Returns a JSON object with: ok (boolean), tool name ('time-diff'), and a result object containing total seconds, total days, business days, a human-readable string (e.g. '9 months, 12 days'), and a calendar object broken down into years, months, and days.

## 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",
      "HEAD"
     ],
     "type": "string"
    },
    "headers": {
     "type": "object",
     "additionalProperties": {
      "type": "string"
     }
    },
    "queryParams": {
     "type": "object",
     "required": [
      "start"
     ],
     "properties": {
      "tz": {
       "type": "string"
      },
      "end": {
       "type": "string"
      },
      "start": {
       "type": "string"
      }
     },
     "additionalProperties": false
    },
    "discoverable": {
     "type": "boolean"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "time-diff",
  "result": {
   "days": 278,
   "human": "9 months, 12 days",
   "seconds": 24019200,
   "calendar": {
    "days": 12,
    "years": 0,
    "months": 9
   },
   "businessDays": 198
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/swift-bot-labs-toolbox-time-difference-calculator-2b799239/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-toolbox.swiftbotlab.workers.dev](https://www.zero.xyz/host/x402-toolbox.swiftbotlab.workers.dev/llms.txt)
