Timezone API
Introducing the Timezone API, a simple and reliable way to fetch timezone information for a geographical location using its location ID and an optional date and time.
The API allows you to retrieve the timezone of a selected location by passing its place_id. You can also provide a specific date and time to retrieve timezone information for that moment.
API Endpoint
POST https://geolocation.divineapi.com/timezoneGuide: Use this endpoint to retrieve timezone information for a given geographical location.
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Your API Access Token. Example: Bearer {token} |
Fields marked with * are mandatory.
Request Body
| Name | Type | Description |
|---|---|---|
| api_key* | String | Your API key from the DivineAPI dashboard. |
| place_id* | Integer | Unique location ID obtained from the Location API. |
| day | Integer | Day of the month (1–31). Optional. |
| month | Integer | Month of the year (1–12). Optional. |
| year | Integer | Year for which timezone information is required. Optional. |
| hour | Integer | Hour of the day (24-hour format). Optional. |
| min | Integer | Minute (0–59). Optional. |
| sec | Integer | Second (0–59). Optional. |
Fields marked with * are mandatory.
Note: The place_id can be obtained from the Location API.
Date and Time Behavior:
If day, month, year, hour, min, and sec are provided, the API returns timezone information for the specified date and time.
If these parameters are not provided, the API automatically uses the current date and time to determine the timezone.
200: OK
{
"status": "success",
"code": 200,
"message": "Request successful",
"data": {
"place": {
"place_id": 3824300,
"name": "Xiloxúchitl",
"full_name": "Xiloxúchitl, Veracruz, Mexico",
"country": "MX",
"admin1": "Veracruz",
"latitude": 21.34639,
"longitude": -98.2706,
"timezone": "America/Mexico_City"
},
"timezone": "America/Mexico_City",
"local_datetime": "2026-11-18 05:54:24",
"utc_datetime": "2026-11-18 11:54:24",
"timezone_value": -6,
"utc_offset": "-06:00",
"is_dst": false,
"ambiguous": false
},
"attribution": "Place data © GeoNames (geonames.org), CC BY 4.0"
}Example Code Implementations
Below are example implementations in various programming environments.
cURL
curl --location 'https://geolocation.divineapi.com/timezone' \
--header 'Authorization: Bearer {YOUR_AUTH_TOKEN}' \
--form 'api_key="{YOUR_API_KEY}"' \
--form 'place_id="3824300"' \
--form 'day="15"' \
--form 'month="7"' \
--form 'year="1990"' \
--form 'hour="14"' \
--form 'min="30"' \
--form 'sec="0"'