Get the Timezone of a Location

How to retrieve the timezone and time offsets useful to compute a local time from a location

  1. Overview
  2. Optional parameters
  3. Response
  4. Usage limits

Overview

This API endpoint allows you to retrieve the timezone and the data associated with it from a provided location.

You can query the API using your public or private key according to your use case and calls origins.

Required parameters

All parameters are separated using the ampersand (&) character. Only your Woosmap API key and the location fields are mandatory to use the timezone endpoint.

        https://api.woosmap.com/geolocation/timezone/?key={PUBLIC_API_KEY}&location=43.6114130,3.8735291&timestamp=1708440298

    

location

The location you need to retrieve time zone infos from. It should be supplied in the form of latitude,longitude coordinates. Ensure that no space exists between the latitude and longitude values (e.g. 43.6114130,3.8735291).

key

Your project’s API key. This key identifies your Woosmap Project for purposes of quota management. (you should use key client side and private_key server side)

Optional parameters

timestamp

In addition to a location, you can specify a timestamp value to get time offsets for a dedicated date. This parameter is commonly used to get specific offset of locations where Daylight Saving Time (DST) is used.

        e.g. 22/09/2020 20:26:13 ==> 1600799173

    

Response

For a provided location, the response is a formatted JSON containing the keys:

timezone the time zone associated with location, as specified by the IANA Time Zone Database. Also known as TZ identifier
timezone_name the time zone abbreviations for both Standard Time and Daylight Saving Time for a location
raw_offset the offset from the Coordinated Universal Time (UTC) in seconds
dst_offset the Daylight Saving Time (DST) offset in seconds

As an example and assuming you want to compute the local time of a location in Paris end of July you’ll get this kind of response:

        {
    "timezone": "Europe/Paris",
    "timezone_name": "CEST",
    "raw_offset": 3600,
    "dst_offset": 3600
}

    

In this case, for this location (Paris), local time is +1h from UTC and +1h for DST according to the timestamp provided (a date in July).

Usage limits

The following usage limits are in place for the /timezone endpoint of Geolocation API:

Was this article helpful?
Have more questions? Submit a request