# Datetime Diff Tool (Time Difference Calculator)

> Datetime Diff Tool (Time Difference Calculator) is a paid API for AI agents from lin-desk-x402.lindesk.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Computes the difference between two datetime values, returning the result in days and seconds

## Facts

- Endpoint: GET https://lin-desk-x402.lindesk.workers.dev/v1/timetools/diff?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/datetime-diff-tool-time-difference-calculator-45da1648
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KrW1_br7PE9ZU6Pxqtkty

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 datetime-diff-tool-time-difference-calculator-45da1648
```

Example prompt: What's the difference between January 15, 2024 and March 28, 2024 — how many days and seconds apart are they?

## When to prefer this

Choose this endpoint when you need a quick, pay-per-call computation of the time difference between two datetimes without managing API keys or subscriptions. It is ideal for AI agents that need lightweight date arithmetic as part of a larger workflow, especially in environments that support x402 micropayments on Base.

## Known failure modes

- Missing required 'input' query parameter returns an error
- Malformed or unparseable datetime strings may cause computation failure
- Non-GET HTTP methods are rejected (only GET is supported)
- Payment not sent or insufficient USDC triggers a 402 Payment Required response
- Providing only one datetime without both 'a' and 'b' may return an unexpected result

## How this service works

Pay-per-call API for AI agents: turn any public web page or PDF into clean, LLM-ready Markdown. $0.002 per call in USDC on Base via x402. No API key, no signup.

## Output

A JSON object with the operation name ('diff'), metadata including input/output character counts and elapsed milliseconds, and a result object containing the time difference expressed as decimal days and total seconds.

## 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",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "input"
     ],
     "properties": {
      "a": {
       "type": "string"
      },
      "b": {
       "type": "string"
      },
      "input": {
       "type": "string",
       "description": "Datetime / unix / ISO string (empty for diff with a,b)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "op": {
       "type": "string"
      },
      "meta": {
       "type": "object",
       "properties": {
        "chars_in": {
         "type": "integer"
        },
        "chars_out": {
         "type": "integer"
        },
        "elapsed_ms": {
         "type": "integer"
        }
       }
      },
      "result": {}
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "op": "diff",
  "meta": {
   "chars_in": 0,
   "chars_out": 32,
   "elapsed_ms": 0
  },
  "result": {
   "days": 2.5,
   "seconds": 216000
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/datetime-diff-tool-time-difference-calculator-45da1648/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lin-desk-x402.lindesk.workers.dev](https://www.zero.xyz/host/lin-desk-x402.lindesk.workers.dev/llms.txt)
