Get a location's timezone

The /geoservices/timezone endpoint provides the following timezone information for a given location (provided as latitude and longitude):

  1. The Daylight Savings Time (DST) offset in seconds (or 0 if no daylight savings time is in effect).
  2. The offset in seconds from UTC for the given location.
  3. The timezone ID, for example “Australia/Brisbane”, as defined by the Unicode Common Locale Data Repository (CLDR).

Request a place’s timezone

Endpoint: /geoservices/timezone Operation: GET

Request parameters

Parameter Mandatory/optional Description
location Mandatory Where (latitude and longitude) you want to obtain the timezone. The co-ordinates must be provided as a comma-separated array. A location’s co-ordinates can be obtained from the /geoservices/geocode endpoint.
timestamp Mandatory When (date and time) the timezone information is required for, given in seconds from 1 January 1970 (Unix time), which should be used to calculate the DST offset.

Note that timezone data may not be available for locations over bodies of water, such as oceans or seas.

For more information, please see the API documentation.

Example

This example shows how to find the timezone of Melbourne, Australia in March 2023.

  1. Use the /geoservices/geocode endpoint to get the latitude and longitude of a location in Melbourne, for example Port Melbourne is at latitude -37.839485 and longitude 144.925550.

  2. Obtain the timestamp you require. This example uses 29 March 2023 at 8:00:00, which is 1680076800s.

  3. Send a GET request to the /geoservices/timezone endpoint with the location and timestamp in the query:

https://<base URL>/geoservices/timezone?location=-37.839485%2c144.925550&timestamp=1680076800

The following is returned:

{
	"dstOffset": 3600,
	"rawOffset": 36000.0,
	"timeZoneId": "Australia/Melbourne"
}

From the response, we can see that the timezone of our location is Melbourne, Australia, which is normally in the UTC +10 hours timezone. This is obtained from the raw offset of 36000 seconds, which is 10 hours.

In March 2023, however, there was daylight savings. The dst offset of 3600 seconds (+1 hour) indicates that Melbourne was UTC +11 hours at the timestamp we provided.