You can easily convert the time in one location and time zone to the time in another location and time zone by using our free time API.
Our time API is available in JSON format and easily accessible through a simple API request over a secure HTTPS connection.
The base URL for our time API is
https://www.amdoren.com/api/time.php
Request Parameters
All the API request parameters are required.
Parameter | Description |
---|---|
api_key | Your assigned API key. |
from | Location and time zone in which you would like to convert the time from. |
time | Local time to convert from. |
to | Location and time zone in which you would like to convert the time to. |
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 convert the time in New York to the time in London:
https://www.amdoren.com/api/time.php?api_key=IBZzdLmM2yCYaXjgTZ6x&from=New+York&time=2016-12-25+21%3A30&to=London
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 | Converted date & time in the to location in the format YYYY-MM-DD hh:mm. |
diff | Time difference in minutes. |
diff_hr | Time difference in hours. |
Example:
JSON data returned from our time API request:
{ "error" : 0, "error_message" : "-", "time" : "2016-12-26 02:30", "diff" : "300", "diff_hr" : "5.0" }
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 | From location not provided. |
250 | To location not provided. |
300 | Time not provided. |
310 | Invalid time. |
400 | API limit reached for the month. |
500 | From location not found. |
600 | To location not found. |
Our free time API is highly stable & reliable. See our uptime