How to Get the Time Zone from Latitude and Longitude: Timezone API, Geocoding, or Offline Data

World map with day and night: local time, UTC offset and IANA time zone for Phoenix, New York, Paris, Tokyo, Sydney
World map with day and night: local time, UTC offset and IANA time zone for Phoenix, New York, Paris, Tokyo, Sydney

To get the time zone from latitude and longitude, call the Timezone API: it returns the IANA time zone name, the UTC offset in effect, and the local time for any moment you ask about. Local time matters whenever you schedule appointments, show opening hours, or promise delivery windows across regions. Depending on what you already have, there are three ways to get it:

  • Timezone API: the exact offset, abbreviation and local time at a given instant, plus the next daylight saving change.
  • Geocoding timezone object: the zone name and both standard and daylight offsets, returned with the address if you already geocode.
  • Offline dataset or library: time zone boundaries that you host and query yourself, with no API calls.

Three Ways to Get a Time Zone from Coordinates

A time zone is a region of the world where all locations follow the same clock rules. To find the time zone of a point, you find the region that contains it and read its rules from the IANA Time Zone Database, the reference used by operating systems and programming languages.

You can do this lookup through an API or locally. Libraries such as geo-tz work offline, but they ship large boundary files, so they suit servers better than browsers or mobile apps. Here is how the three options compare:

Timezone APIGeocoding timezone objectOffline dataset or library
InputCoordinates, optional instant (at)Address or coordinatesCoordinates
ReturnsIANA name, offset in effect, abbreviation, local time, next transitionIANA name, offset_STD and offset_DST, both abbreviationsIANA name (and whatever the dataset includes)
Exact offset at a given dateYesNo: both offsets, no indication which applies nowOnly with an extra time zone library
Local timeYes, local_timeCompute it from the IANA nameCompute it from the IANA name
Daylight saving changesNext transition; all transitions in a period via /transitionsNoDepends on the library
Cost1 credit per requestIncluded with the address (1 geocoding request)No API calls; you host and update the data
Best forScheduling, local time at a moment, DST-aware appsApps that already geocode addressesHigh-volume or offline lookups with your own infrastructure

The sections below show each option with a real request and response.

Option 1: Timezone API

The Timezone API answers one question directly: which offset and local time apply at this location at this moment. Send the coordinates and, optionally, the instant in the at parameter:

https://api.geoapify.com/v1/timezone?lat=46.73917926727481&lon=2.3276588684885837&at=2026-10-23T12:00:00Z&apiKey=YOUR_API_KEY

For this point near Morlac in central France, the API returns Europe/Paris with summer time still in effect, and the change back to standard time two days later:

{
  "lat": 46.73917926727481,
  "lon": 2.3276588684885837,
  "at": "2026-10-23T12:00:00.000Z",
  "tzdb_version": "2026e",
  "timezones": [
    {
      "name": "Europe/Paris",
      "type": "daylightSaving",
      "utc_offset": "+02:00",
      "offset_seconds": 7200,
      "abbreviation": "CEST",
      "local_time": "2026-10-23T14:00:00.000+02:00",
      "next_transition": {
        "at": "2026-10-25T01:00:00.000Z",
        "before": { "type": "daylightSaving", "utc_offset": "+02:00", "abbreviation": "CEST", ... },
        "after": { "type": "standard", "utc_offset": "+01:00", "abbreviation": "CET", ... },
        "offset_change_seconds": -3600,
        "kind": "daylight-end"
      }
    }
  ]
}

In JavaScript, read the offset and local time from the first entry in timezones:

const lat = 46.73917926727481;
const lon = 2.3276588684885837;

fetch(`https://api.geoapify.com/v1/timezone?lat=${lat}&lon=${lon}&apiKey=YOUR_API_KEY`)
  .then(resp => resp.json())
  .then((result) => {
    const timezone = result.timezones[0];
    console.log(timezone.name);       // "Europe/Paris"
    console.log(timezone.utc_offset); // offset in effect now
    console.log(timezone.local_time); // local time now
  });

The at value must be a full RFC 3339 timestamp with a time and an offset, such as 2026-10-23T12:00:00Z or 2026-10-23T14:00:00+02:00. Without at, the API uses the current time. Supported instants run from 2025-01-01 through 2031-12-31 UTC.

To plan ahead, /v1/timezone/transitions with from and to lists every offset change at the location in an interval of up to 366 days. For New York in 2026, it returns two transitions: daylight saving time starts on 8 March and ends on 1 November.

AI assistants can call the same lookup as the get_timezone tool on Geoapify MCP Server. For all parameters and response fields, see the Timezone API documentation.

Option 2: Time Zone from Geocoding Results

If you already geocode addresses or coordinates, you may not need a separate call: Geoapify geocoding results include a timezone object. It works for both directions, from coordinates and from an address.

Time zone by coordinates

The Reverse Geocoding API returns the address and time zone for a latitude and longitude. You need an API key: register via Getting started; the Free plan includes 3,000 credits per day.

Here's an example of an API request for the same point:

https://api.geoapify.com/v1/geocode/reverse?lat=46.73917926727481&lon=2.3276588684885837&format=json&apiKey=YOUR_API_KEY

With format=json, the response is an object with a results array. Here is how to read the time zone in JavaScript:

fetch(`https://api.geoapify.com/v1/geocode/reverse?lat=${lat}&lon=${lon}&format=json&apiKey=YOUR_API_KEY`)
  .then(resp => resp.json())
  .then((result) => {
    if (result.results && result.results.length) {
      console.log(result.results[0].timezone);
    } else {
      console.log("No location found");
    }
  });

The first result contains the nearest address and its time zone (simplified response):

{
  "results": [
    {
      "housenumber": "527",
      "street": "Route Du Danger",
      "postcode": "18170",
      "city": "Morlac",
      "county": "Cher",
      "state": "Centre",
      "country": "France",
      "country_code": "fr",
      "lon": 2.325659,
      "lat": 46.732123,
      "formatted": "527 Route Du Danger, 18170 Morlac, France",
      "timezone": {
        "name": "Europe/Paris",
        "offset_STD": "+01:00",
        "offset_STD_seconds": 3600,
        "offset_DST": "+02:00",
        "offset_DST_seconds": 7200,
        "abbreviation_STD": "CET",
        "abbreviation_DST": "CEST"
      },
      ...
    }
  ],
  ...
}

The timezone object gives the zone name and both offsets: standard time (STD) and daylight saving time (DST), as a string and in seconds. It does not tell you which of them applies right now. If you need the offset in effect at a given moment, use the Timezone API from Option 1. The full list of result fields is in the Reverse Geocoding API documentation.

Time zone by address

If you only have a postal address, the Geocoding API returns its coordinates, structured address and time zone in one request.

Here is an example of the API call URL where the URL encoded address (Carrer del Pintor Navarro Llorens, 7, 46008 València, Valencia, Spain) is provided in the text parameter:

https://api.geoapify.com/v1/geocode/search?text=Carrer%20del%20Pintor%20Navarro%20Llorens%2C%207%2C%2046008%20Val%C3%A8ncia%2C%20Valencia%2C%20Spain&format=json&apiKey=YOUR_API_KEY

The first result includes the location coordinates, time zone, and structured address (simplified response):

{
  "results": [
    {
      "housenumber": "7",
      "street": "Carrer del Pintor Navarro Llorens",
      "suburb": "Extramurs",
      "city": "Valencia",
      "postcode": "46008",
      "country": "Spain",
      "lon": -0.3874807,
      "lat": 39.4669989,
      "formatted": "Carrer del Pintor Navarro Llorens, 7, 46008 Valencia, Spain",
      "timezone": {
        "name": "Europe/Madrid",
        "offset_STD": "+01:00",
        "offset_STD_seconds": 3600,
        "offset_DST": "+02:00",
        "offset_DST_seconds": 7200,
        "abbreviation_STD": "CET",
        "abbreviation_DST": "CEST"
      },
      ...
    }
  ],
  ...
}

In JavaScript, encode the address with encodeURIComponent() and read the time zone from the first result:

const address = 'Carrer del Pintor Navarro Llorens, 7, 46008 València, Valencia, Spain';

fetch(`https://api.geoapify.com/v1/geocode/search?text=${encodeURIComponent(address)}&format=json&apiKey=YOUR_API_KEY`)
  .then(resp => resp.json())
  .then((geocodingResult) => {
    console.log(geocodingResult.results[0].timezone);
  });

Option 3: Offline Time Zone Data

The third option is to keep time zone boundaries yourself. Geoapify provides a timezone dataset with IANA metadata and GeoJSON boundaries, and libraries like geo-tz bundle similar data for Node.js.

ProsCons
No network calls and no per-request costYou update the data with each IANA release
Full control over hosting and performanceYou ship and load large boundary files
Works without an internet connectionYou run the point-in-polygon lookup yourself

This option fits batch processing and high-volume server workloads. For web and mobile apps, an API call is usually lighter.

Get the Location's Local Time

Daylight saving rules differ by country and change by law, so don't add offsets to UTC by hand. Use a source that knows the rules for the date you need.

With the Timezone API, read local_time directly from the response, for example 2026-10-23T14:00:00.000+02:00 for Paris. With an IANA name from geocoding or the dataset, let the runtime apply the rules. Here is a JavaScript code sample that gets local times for different time zones:

const now = new Date();

console.log('Current UTC time: ' + now.toISOString());
console.log('Current Chicago time: ' + now.toLocaleString("en-US", { timeZone: "America/Chicago" }));
console.log('Current Berlin time: ' + now.toLocaleString("de-DE", { timeZone: "Europe/Berlin" }));

The code sample uses the JavaScript Date object and its toLocaleString() function, which converts a date into a string for the given time zone and locale.

Rule of thumb: store the IANA name (Europe/Paris), not the offset (+02:00). The offset changes during the year; the name stays the same and always resolves to the right offset for a given date.

Frequently Asked Questions

What is a timezone API?

A timezone API returns the time zone for a location. The Geoapify Timezone API takes latitude and longitude and returns the IANA time zone name, the UTC offset in effect, the abbreviation, the local time and the next daylight saving transition.

How do I get the time zone from latitude and longitude?

Send a GET request to https://api.geoapify.com/v1/timezone?lat=LAT&lon=LON&apiKey=YOUR_API_KEY and read timezones[0].name. See the Timezone API documentation.

Is there a free timezone API?

Yes. The Geoapify Free plan includes 3,000 credits per day, and one Timezone API request costs 1 credit. See the pricing page.

How do I get the local time for coordinates?

Call the Timezone API and read local_time. Add the at parameter, for example 2026-10-23T12:00:00Z, to get the local time at a specific instant. If you only have an IANA name, use toLocaleString() with the timeZone option.

Why does the UTC offset change twice a year?

Because of daylight saving time: many regions move clocks forward in spring and back in autumn. Paris uses +01:00 (CET) in winter and +02:00 (CEST) in summer. The Timezone API shows the next change in next_transition.

Can I get the time zone for an address?

Yes. Geoapify Geocoding API results include a timezone object with the IANA name and the standard and daylight offsets. For the offset in effect at a given moment, pass the result coordinates to the Timezone API.

What's next