convert-time-zone
Converts a local time from one zone to another. GET https://opentz.noomad.org/v2.1/convert-time-zone
Parameters
| Parameter | Required | Description |
key | Required | Your API key, from your account. |
format | Optional | xml (default) or json. |
callback | Optional | JavaScript function name for a JSONP response. |
fields | Optional | Comma-separated list (no spaces) of the fields to return. Default: all fields of the endpoint. |
from | Required | Source zone name or abbreviation. |
to | Required | Destination zone name or abbreviation. |
time | Optional | Local Unix time in the source zone. Default: now. |
Response
| Field | Description |
fromZoneName, fromAbbreviation, fromTimestamp | Source zone, its abbreviation and the source local time. |
toZoneName, toAbbreviation, toTimestamp | Destination zone, its abbreviation and the destination local time. |
toFormatted | Destination local time formatted as YYYY-MM-DD HH:mm:ss (only when requested through fields). |
offset | Difference in seconds between the two zones at that instant. |
Example
GET https://opentz.noomad.org/v2.1/convert-time-zone?key=YOUR_API_KEY&format=json&from=America/Los_Angeles&to=Australia/Sydney&time=1464793200
{"status":"OK","message":"","fromZoneName":"America\/Los_Angeles","fromAbbreviation":"PDT","fromTimestamp":1464793200,"toZoneName":"Australia\/Sydney","toAbbreviation":"AEST","toTimestamp":1464854400,"offset":61200}