# tz-convert

> IANA time zone conversion: an instant (ISO with offset, Z, or Unix) or a local wall time in a source zone converted to up to 20 zones, with UTC offset, abbreviation and DST gap/overlap handling (ambiguous times return both instants).

- URL: https://forge-tools.dentreprise.workers.dev/api/tz-convert (GET or POST)
- Price: 0.001 USDC on Base (1000 atomic USDC)
- MCP tool: tz_convert
- Docs: https://agent-hub.dentreprise.workers.dev/tools/tz-convert/

## Parameters

- `time` (string): ISO date-time or local time; default now
- `from` (string): Source IANA zone for local times, default UTC
- `to` (string, required): Target zones, comma-separated

## Unpaid example

```bash
curl -sS -D - "https://forge-tools.dentreprise.workers.dev/api/tz-convert?time=2026-03-29T02%3A30&from=Europe%2FParis&to=America%2FNew_York%2CAsia%2FTokyo"
```

## Example 402 challenge

```json
{
  "x402Version": 2,
  "error": "Payment required",
  "resource": {
    "url": "https://forge-tools.dentreprise.workers.dev/api/tz-convert",
    "description": "IANA time zone conversion: an instant (ISO with offset, Z, or Unix) or a local wall time in a source zone converted to up to 20 zones, with UTC offset, abbreviation and DST gap/overlap handling (ambiguous times return both instants).",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "amount": "1000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0x7B8bf45ac6AcbA6D4CFB626b57D3f5fF3C9C89F7",
      "maxTimeoutSeconds": 120,
      "extra": {
        "name": "USD Coin",
        "version": "2"
      }
    }
  ]
}
```

## Example response

```json
{
  "status": "ok",
  "results": [
    {
      "utc": "2026-11-10T15:00:00.000Z",
      "targets": [
        {
          "zone": "Asia/Tokyo",
          "local": "2026-11-11T00:00:00",
          "offset": "+09:00"
        }
      ]
    }
  ]
}
```

## Free demo / sample

This tool accepts `?demo=1` on the wave-1 worker (labelled sample, HTTP 200, not live data). The first 3 successful real calls per IP per UTC day are also free.

```bash
curl -sS "https://forge-tools.dentreprise.workers.dev/api/tz-convert?time=2026-03-29T02%3A30&from=Europe%2FParis&to=America%2FNew_York%2CAsia%2FTokyo&demo=1"
```

```json
{
  "demo": true,
  "demo_label": "DEMO / SAMPLE — not live data. This is a labelled example response and was not charged.",
  "charged": false,
  "tool": "/api/tz-convert",
  "docs": "https://agent-hub.dentreprise.workers.dev/tools/tz-convert/",
  "how_to_get_live_data": "Call the same URL without demo=1. The first 3 successful real calls per IP per UTC day are free; after that attach an x402 v2 PAYMENT-SIGNATURE (USDC on Base).",
  "sample": {
    "status": "ok",
    "results": [
      {
        "utc": "2026-11-10T15:00:00.000Z",
        "targets": [
          {
            "zone": "Asia/Tokyo",
            "local": "2026-11-11T00:00:00",
            "offset": "+09:00"
          }
        ]
      }
    ]
  }
}
```

## Clients

- JS (x402 v2): `@x402/fetch` + `@x402/evm` (`wrapFetchWithPaymentFromConfig`, `ExactEvmScheme`). The older package `x402-fetch` is deprecated v1.
- Python: PyPI package `x402` (`x402HttpxClient` or `x402_requests`, `register_exact_evm_client`, `EthAccountSigner`).
- MCP: stdio `node src/server.mjs` in [forge-agent-mcp](https://github.com/forge-agent-hub/forge-agent-mcp); hosted Streamable HTTP at https://x402-gateway.forge-x402.workers.dev/mcp (original gateway tools).
- LangChain: wrap those clients with `DynamicStructuredTool` (`@langchain/core`) or `@tool` (`langchain_core`).
- Copy-paste snippets: https://agent-hub.dentreprise.workers.dev/tools/tz-convert/ and https://agent-hub.dentreprise.workers.dev/quickstart/
