agentsvc.io

services / timezone

dataoperational · 33 ms

Timezone & Local Time

Resolve a city name or coordinates to its IANA timezone and return the current local time, UTC offset, DST flag and weekday. Use for scheduling across regions, 'what time is it in X', or normalizing timestamps. Params: location (required, e.g. 'Tokyo' or '35.68,139.69').

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/timezone", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"location":"Tokyo"}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
location *stringCity name or 'lat,lon'

Output

FieldTypeDescription
locationobject
timezonestringIANA timezone, e.g. Asia/Tokyo
abbreviationstring
utc_offsetstringe.g. +09:00
utc_offset_secondsinteger
is_dstboolean
local_timestringISO 8601 with offset
local_datestring
weekdaystring
utc_timestring
unix_timeinteger

Example response (data)

{
  "location": {
    "name": "Tokyo",
    "country": "Japan",
    "lat": 35.6895,
    "lon": 139.6917
  },
  "timezone": "Asia/Tokyo",
  "abbreviation": "JST",
  "utc_offset": "+09:00",
  "utc_offset_seconds": 32400,
  "is_dst": false,
  "local_time": "2026-09-09T21:00:00+09:00",
  "local_date": "2026-09-09",
  "weekday": "Wednesday",
  "utc_time": "2026-09-09T12:00:00.000Z",
  "unix_time": 1788955200
}