Utilities · x402

Timezone-aware date arithmetic: add or subtract a duration to a datetime (days are cale…

Timezone-aware date arithmetic: add or subtract a duration to a datetime (days are calendar-based and DST-safe; hours and minutes are absolute), or compute the difference between two datetimes that may be in different zones.

by api.agishub.com · discovered, not yet claimed by its owner · updated 2026-09-07

Mirrored from Coinbase's public x402 Bazaar. The description is the provider's own text and has not been reviewed here; the payment requirements are copied as published.

What it does

Timezone-aware date arithmetic: add or subtract a duration to a datetime (days are calendar-based and DST-safe; hours and minutes are absolute), or compute the difference between two datetimes that may be in different zones.

Tags: bazaar

Use with an agent

  1. Discover. Agents find this listing with GET https://bazaar.saylorinnovations.com/discovery/search?query=…, the MCP tool search_resources, or /discovery/resources.
  2. Inspect. Fetch /resources/12968.json for the price and payment options.
  3. Pay. Call GET https://api.agishub.com/paid/date-calculate. The provider answers 402 with its payment requirements. An x402 client signs one of the options below and retries with PAYMENT-SIGNATURE.
  4. Execute. The provider returns 200 with the data. Agent Bazaar is not in the request path and never sees your payment.

For humans

You don't need an account or an API key; you need a wallet holding a small amount of USDC on Base, and an x402-capable client (see the examples below). Call the endpoint unpaid first to see exactly what it asks for.

Pricing & payment

Price
$0.01 / request
Protocol
x402 v2
Auth
No account or API key. Pay per request.
Networks
Base
Calls (30d)
1 · 1 unique payers (third-party data from the public x402 Bazaar)

x402 payment requirements

SchemeNetworkAssetAmountPay toTimeout
exactBase
eip155:8453
USDC$0.010x23Fc725e8EAa1c58900C6507Ba89be99a6DFc75d300s
accepts[] (raw JSON)
[
  {
    "scheme": "exact",
    "network": "eip155:8453",
    "payTo": "0x23Fc725e8EAa1c58900C6507Ba89be99a6DFc75d",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "10000",
    "amountUsd": 0.01,
    "maxTimeoutSeconds": 300
  }
]

Schemas

Output schema (JSON Schema)
{
  "bazaar": {
    "info": {
      "input": {
        "body": {
          "datetime": "2026-12-25",
          "operation": {
            "amount": 1,
            "to_datetime": "2026-12-25",
            "to_timezone": "Europe/Madrid",
            "type": "add",
            "unit": "seconds"
          },
          "timezone": "Europe/Madrid"
        },
        "bodyType": "json",
        "method": "POST",
        "type": "http"
      },
      "output": {
        "example": {
          "result": "Timezone-aware date arithmetic: add or subtract a duration to a datetime (days are calendar-based and DST-safe; hours an"
        },
        "type": "json"
      }
    },
    "schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "properties": {
        "input": {
          "additionalProperties": false,
          "properties": {
            "body": {
              "additionalProperties": false,
              "properties": {
                "datetime": {
                  "description": "Base datetime: ISO 8601 or natural language.",
                  "type": "string"
                },
                "operation": {
                  "additionalProperties": false,
                  "description": "What to compute: { type:'add', amount, unit } to add/subtract a duration, or { type:'diff', to_datetime, to_timezone? } for the difference between two datetimes.",
                  "properties": {
                    "amount": {
                      "description": "For type 'add': how much to shift. Use a negative number to subtract.",
                      "type": "number"
                    },
                    "to_datetime": {
                      "description": "For type 'diff': the second datetime (ISO 8601 or natural language).",
                      "type": "string"
                    },
                    "to_timezone": {
                      "description": "For type 'diff': the IANA timezone of to_datetime (defaults to the base timezone).",
                      "type": "string"
                    },
                    "type": {
                      "description": "'add' to shift the datetime by a duration, or 'diff' to measure the gap between two datetimes.",
                      "enum": [
                        "add",
                        "diff"
                      ],
                      "type": "string"
                    },
                    "unit": {
                      "description": "For type 'add': one of seconds, minutes, hours, days, weeks.",
                      "enum": [
                        "seconds",
                        "minutes",
                        "hours",
                        "days",
                        "weeks"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": "object"
                },
                "timezone": {
                  "description": "IANA timezone the base datetime is in.",
                  "type": "string"
                }
              },
              "required": [
                "datetime",
                "timezone",
                "operation"
              ],
              "type": "object"
            },
            "bodyType": {
              "enum": [
                "json"
              ],
              "type": "string"
            },
            "method": {
              "enum": [
                "POST"
              ],
              "type": "string"
            },
            "type": {
              "enum": [
                "http"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "method",
            "bodyType",
            "body"
          ],
          "type": "object"
        },
        "output": {
          "additionalProperties": false,
          "properties": {
            "example": {
              "type": "object"
            },
            "type": {
              "enum": [
                "json"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "example"
          ],
          "type": "object"
        }
      },
      "required": [
        "input",
        "output"
      ],
      "type": "object"
    }
  }
}
Example shape — generated from the schema, not a captured live response
null

Examples

curl
curl "https://api.agishub.com/paid/date-calculate"
# -> 402 Payment Required, accepts[] lists how to pay
# retry with a PAYMENT-SIGNATURE (or PAYMENT header) once paid
JavaScript
const res = await fetch("https://api.agishub.com/paid/date-calculate");
if (res.status === 402) {
  const { accepts } = await res.json();
  // pay one of accepts[] via an x402 client, then retry with the payment header
}
Python
import httpx
res = httpx.get("https://api.agishub.com/paid/date-calculate")
if res.status_code == 402:
    accepts = res.json()["accepts"]
    # pay one of accepts[] via an x402 client, then retry with the payment header

Details

Provider
api.agishub.com
Endpoint
https://api.agishub.com/paid/date-calculate
Machine-readable
/resources/12968.json