Timezone lookup
The timezone of a point, and the offset in force there at a given moment.
GEThttps://api.mygeocode.com/v1/timezone
Parameters
| Parameter | Type | Description |
|---|---|---|
latrequired* | number | -90 to 90. |
lonrequired | number | -180 to 180. |
locationsoptional | string | *Alternative to lat and lon: up to 100 points as lat,lon|lat,lon|... or as an encoded polyline enc:.... Each point counts as one request; the answer has a results array in input order. |
path, samplesoptional | string, integer | *Alternative to lat and lon: samples points (2 to 100) evenly spaced along the path lat,lon|lat,lon|..., first and last point included. Answered like locations. |
bounds, rows, colsoptional | string, integer | *Alternative to lat and lon: a grid of rows by cols points (each at least 2, at most 100 points in all) over south,west,north,east, southern row first, west to east. Answered like locations. |
tzoptional | string | *Alternative to coordinates: an IANA zone id such as Europe/Zurich (a Windows id is accepted too). Returns the same fields for that zone without a boundary lookup. |
timestampoptional | integer | Unix time in seconds. Default: now. Any moment from 1900 to 2100 is accepted; future offsets use the rules currently published. |
languageoptional | string | Language for name, e.g. de or pt-BR. Default English. |
keyoptional | string | API key, if not sent as a header. |
Example
$ curl -H "X-API-Key: YOUR_KEY" "https://api.mygeocode.com/v1/timezone?lat=-33.8688&lon=151.2093×tamp=1767225600"const url = new URL("https://api.mygeocode.com/v1/timezone");
url.searchParams.set("lat", -33.8688);
url.searchParams.set("lon", 151.2093);
url.searchParams.set("timestamp", 1767225600); // 2026-01-01T00:00:00Z
const tz = await (await fetch(url, { headers: { "X-API-Key": "YOUR_KEY" } })).json();
console.log(tz.timezone, tz.utc_offset, tz.dst);import requests
tz = requests.get("https://api.mygeocode.com/v1/timezone",
params={"lat": -33.8688, "lon": 151.2093, "timestamp": 1767225600}, headers={"X-API-Key": "YOUR_KEY"}, timeout=5).json()
print(tz["timezone"], tz["utc_offset"], tz["dst"])Response
{
"status": "ok",
"lat": -33.8688,
"lon": 151.2093,
"timezone": "Australia/Sydney",
"name": "Australian Eastern Daylight Time",
"abbreviation": "AEDT",
"utc_offset": "+11:00",
"utc_offset_seconds": 39600,
"raw_offset_seconds": 36000,
"dst": true,
"dst_offset_seconds": 3600,
"timestamp": 1767225600,
"local_time": "2026-01-01T11:00:00+11:00",
"country_code": "AU",
"is_ocean": false,
"windows_timezone": "AUS Eastern Standard Time",
"next_transition": {
"timestamp": 1775318400,
"utc_offset": "+10:00",
"utc_offset_seconds": 36000,
"dst": false,
"abbreviation": "AEST"
}
}Response fields
| Field | Type | Description |
|---|---|---|
lat, lon | number or null | The point you sent, echoed. null when you sent tz. |
timezone | string | IANA name. In international waters, Etc/GMT+n or Etc/GMT-n (note the sign convention is inverted, as in IANA). |
abbreviation | string | Abbreviation at timestamp. For display only; not unique. |
name | string | Long name in force at timestamp, e.g. Australian Eastern Daylight Time. |
utc_offset | string | ±HH:MM at timestamp. |
utc_offset_seconds | integer | The same as a number. |
raw_offset_seconds, dst_offset_seconds | integer | Standard offset and the daylight-saving part on top of it (0 when DST is not in effect). Their sum is utc_offset_seconds. |
dst | boolean | Daylight saving in effect at timestamp. |
timestamp | integer | The moment described. |
local_time | string | RFC 3339 local time with offset. |
country_code | string or null | ISO 3166-1 alpha-2 of the zone, null for the Etc zones at sea. |
is_ocean | boolean | True for the Etc/GMT zones used in international waters. |
windows_timezone | string or null | The matching Windows time zone id from CLDR, e.g. W. Europe Standard Time. |
next_transition | object or null | The next offset change after timestamp, if the zone has one within two years: its timestamp, utc_offset, utc_offset_seconds, dst and abbreviation. |
Notes
- Store the IANA name and convert times with your platform's tz database. Use the offset fields for display or for systems without one.
- Offsets and daylight saving rules follow the IANA time zone database and are updated as new releases are published.
- Boundaries are simplified to about 55 m, so a point within a few metres of a land border may resolve to the neighbouring zone. Territorial waters and the open ocean are covered too; offshore points get the nautical zone (
Etc/GMT+3and so on).
The same lookup in other providers' formats
If you already have code written against one of these providers, keep it: the drop-in host accepts the same path and parameters and answers in that provider's response shape, with this endpoint behind it. See how the drop-ins work.
| Provider | Host | Path |
|---|---|---|
| Google Maps Platform | gapi.mygeocode.com | /maps/api/timezone/json?location=lat,lng×tamp=...&language=.. |
| Bing Maps REST Services | bing.mygeocode.com | /REST/v1/TimeZone/{lat},{lon}?datetime=.../REST/v1/TimeZone/?query=lat,lon/REST/v1/TimeZone/List?timezoneStandard=iana|windows/REST/v1/TimeZone/Convert?datetime=...&fromtz=...&desttz=... |
| LocationIQ | locationiq.mygeocode.com | /v1/timezone?lat=...&lon=... |
Errors
400 invalid_request when lat or lon is missing or out of range, tz is not a known zone, there are more than 100 points, samples, rows or cols would produce more than 100, or timestamp is outside 1900 to 2100. 503 unavailable when the time zone service is temporarily unavailable; nothing is counted.