Timezone API

Get the IANA timezone identifier, UTC offset, DST status, and current local datetime for any lat/lon coordinate. Includes DST transition schedules.

Timezone API

The Timezone API resolves a latitude/longitude point to its IANA timezone identifier, current UTC offset, daylight saving time status, and the current local datetime at that location. DST start/end dates for the current year are also included.

Endpoint

GET https://api.mapzena.com/v1/timezone

Parameters

ParameterTypeRequiredDescription
key string optional Optional in free mode. Required for metered usage above the free allowance.
lat float required Latitude in decimal degrees. Range: -90 to 90.
lon float required Longitude in decimal degrees. Range: -180 to 180.
timestamp integer optional Unix UTC timestamp for which to calculate local time and DST status. Defaults to the current server time.

Example request

bash - curl
curl "https://api.mapzena.com/v1/timezone?lat=48.8566&lon=2.3522&key=YOUR_KEY"

Example response

json
{
  "status":           "ok",
  "lat":              48.8566,
  "lon":              2.3522,
  "timezone_id":      "Europe/Paris",
  "utc_offset":       "+01:00",
  "utc_offset_dst":   "+02:00",
  "utc_offset_secs":  3600,
  "dst_active":       false,
  "dst_start":        "2026-03-29T02:00:00",
  "dst_end":          "2026-10-25T03:00:00",
  "abbreviation":     "CET",
  "abbreviation_dst": "CEST",
  "timestamp_utc":    1745006400,
  "datetime_local":   "2026-04-17T11:00:00+01:00",
  "country_code":     "FR"
}

Response fields

FieldTypeDescription
timezone_idstringIANA timezone database identifier (e.g. America/New_York).
utc_offsetstringCurrent UTC offset in ±HH:MM format, accounting for DST state.
utc_offset_dststringUTC offset when DST is active.
utc_offset_secsintegerCurrent UTC offset in seconds (positive = east of UTC).
dst_activebooleanWhether DST is currently in effect at the given timestamp.
dst_startstringISO 8601 local datetime when DST begins this year. Null if zone has no DST.
dst_endstringISO 8601 local datetime when DST ends this year. Null if zone has no DST.
abbreviationstringStandard time abbreviation (e.g. EST, CET).
abbreviation_dststringDST abbreviation (e.g. EDT, CEST). Null if no DST.
timestamp_utcintegerThe Unix UTC timestamp used for the calculation.
datetime_localstringISO 8601 local datetime including offset suffix.
country_codestringISO 3166-1 alpha-2 country code for the location.

Error codes

HTTPCodeDescription
400missing_coordinateslat or lon is absent.
400invalid_coordinatesCoordinates outside valid range.
404not_foundNo timezone data for this location (e.g. open ocean far from land).
429rate_limit_exceededQuota reached.

Code examples

PHP

php
<?php
$key = 'YOUR_KEY';
$url = "https://api.mapzena.com/v1/timezone?lat=40.7128&lon=-74.0060&key={$key}";
$tz  = json_decode(file_get_contents($url), true);

echo $tz['timezone_id'];    
echo $tz['datetime_local']; 

Python

python
import urllib.request, json

key = "YOUR_KEY"
url = f"https://api.mapzena.com/v1/timezone?lat=40.7128&lon=-74.006&key={key}"

with urllib.request.urlopen(url) as r:
    tz = json.load(r)

print(tz["timezone_id"], tz["utc_offset"])