Docs / Calendar

Timezone

Returns the timezone for a coordinate or a country.

GET/v1/timezone
import { Client } from "@liveapiio/liveapi";

const client = new Client({ token: process.env.LIVEAPI_TOKEN });

const zone = await client.timezone({ latitude: 41.01, longitude: 28.98 });

Request

Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.

FieldTypeDescription
latnumberLatitude. Send with lon, or send country instead.
lonnumberLongitude. Send with lat, or send country instead.
countrystringISO country code. Used when coordinates are omitted.

Response

A 200 response uses one call. Returns the timezone name, UTC offset, whether daylight saving is in effect, and the local time.

Errors

A failed request returns { "error": { "code", "message" } } and does not use a call.

StatusCodeWhen
400invalid_requestSend lat and lon, or country.
404not_foundNo time zone for this point or country.
401unauthorizedThe bearer token is missing or not recognized.

We value your privacy

We use necessary cookies to run this website. With your consent, we would also like to use analytics and marketing cookies. Read our cookie policy.