# Almanac Time API

> Almanac Time API is a paid API for AI agents from almanac.locomot.io, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Performs time zone conversions, epoch lookups, time-diff calculations, business day counting, and holiday checks for a given instant and locale

## Facts

- Endpoint: GET https://almanac.locomot.io/time
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/almanac-time-api-1389c309
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UT3oR7CVH1ld_qzDNsx0N

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 almanac-time-api-1389c309
```

Example prompt: Convert 2025-03-15T09:00:00 from America/New_York to Europe/London and give me the UTC time and Unix epoch for that moment.

## When to prefer this

Use this endpoint when you need authoritative timezone-aware time conversion, Unix epoch lookup, business day calculation between two dates, or holiday detection for a specific country — especially when you need deterministic, database-version-stamped results rather than a simple language model guess about time zones or dates.

## Known failure modes

- Invalid or unrecognized IANA timezone name returns an error
- Malformed ISO-8601 datetime string causes a parsing error
- Unsupported country code for holidays returns an error or empty result
- Missing required parameters for the selected operation (e.g. no start/end for diff) returns a 400-style error
- Ambiguous epoch (seconds vs milliseconds) may produce unexpected results if the wrong magnitude is passed

## How this service works

Deterministic time/timezone truth: DST-aware zone conversion, transition times, business-day & holiday math, epoch<->ISO. Free sample, no payment required: GET /play/time

## Output

Returns a JSON object with the operation type, the converted time in the target timezone (with offset details), the original time in the source timezone, the same UTC instant, a boolean confirming it's the same instant, the Unix epoch in seconds, and the timezone database version used.

## 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",
     "properties": {
      "op": {
       "enum": [
        "convert",
        "zone",
        "diff",
        "business_days",
        "holidays",
        "epoch"
       ],
       "type": "string",
       "description": "operation; default convert"
      },
      "tz": {
       "type": "string",
       "description": "zone/epoch: IANA zone"
      },
      "end": {
       "type": "string",
       "description": "diff/business_days: end"
      },
      "date": {
       "type": "string",
       "description": "holidays: single date to test"
      },
      "when": {
       "type": "string",
       "description": "instant: ISO-8601, epoch, or now"
      },
      "year": {
       "type": "integer",
       "description": "holidays: year"
      },
      "epoch": {
       "type": "number",
       "description": "epoch: seconds or millis"
      },
      "start": {
       "type": "string",
       "description": "diff/business_days: start"
      },
      "to_tz": {
       "type": "string",
       "description": "convert: target IANA zone"
      },
      "country": {
       "type": "string",
       "description": "ISO-3166 alpha-2 (US, GB, …)"
      },
      "from_tz": {
       "type": "string",
       "description": "convert: source IANA zone"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "properties": {
    "op": {
     "type": "string"
    },
    "to": {
     "type": "object"
    },
    "utc": {
     "type": "string"
    },
    "from": {
     "type": "object"
    },
    "engine": {
     "type": "string"
    },
    "same_instant": {
     "type": "boolean"
    },
    "deterministic": {
     "type": "boolean"
    },
    "input_instant": {
     "type": "string"
    },
    "unix_epoch_seconds": {
     "type": "integer"
    },
    "tz_database_version": {
     "type": "string"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/almanac-time-api-1389c309/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from almanac.locomot.io](https://www.zero.xyz/host/almanac.locomot.io/llms.txt)
