You can easily integrate local time into your personal and commercial website and application by using our free time zone API.
Our time zone API provides you with the local time, UTC offset, daylight savings and time zone details. It is available in JSON format and easily accessible through a simple API request over a secure HTTPS connection.
The base URL for our time zone API is
https://www.amdoren.com/api/timezone.php
Request Parameters
All the API request parameters are required.
Parameter | Description |
---|---|
api_key | Your assigned API key. |
loc | Location for which you would like to retrieve the time zone details. |
Check available locations:
You can also retrieve all the available locations using the get locations API.
Location can be specified as:
- City eg "New York"
- Country, City eg "USA, New York"
- Country, State, City eg "USA, New York, Bronx"
Example:
To retrieve the time zone for New York:
https://www.amdoren.com/api/timezone.php?api_key=IBZzdLmM2yCYaXjgTZ6x&loc=New+York
Element | Description |
---|---|
error | Error code. Value greater than zero indicates an error. See list below. |
error_message | Short decription of the error. See list below. |
time | Local date & time in the format YYYY-MM-DD hh:mm:ss. |
timezone | Name of time zone. |
offset | UTC offset in minutes. |
daylight_savings | "In daylight savings" or "No daylight savings". |
Example:
JSON data returned from our time zone API request:
{ "error" : 0, "error_message" : "-", "time" : "2016-11-04 23:18:46", "timezone" : "Eastern Standard Time", "offset" : -240, "daylight_savings" : "In daylight savings" }
The base URL to retrieve all the available locations is
https://www.amdoren.com/api/locations.php
Request Parameters
All the API request parameters are required.
Parameter | Description |
---|---|
api_key | Your assigned API key. |
Element | Description |
---|---|
error | Error code. Value greater than zero indicates an error. See list below. |
error_message | Short decription of the error. See list below. |
locations | Array of location data. |
- country | Country. |
- state | State. |
- city | City. |
Error Code | Description |
---|---|
0 | No error. |
100 | API key not provided. |
110 | Invalid API key. |
200 | Location not provided. |
400 | API limit reached for the month. |
500 | Location not found. |
Our free time zone API is highly stable & reliable. See our uptime