OpenTZ

convert-time-zone

Converts a local time from one zone to another. GET https://opentz.noomad.org/v2.1/convert-time-zone

Parameters

ParameterRequiredDescription
keyRequiredYour API key, from your account.
formatOptionalxml (default) or json.
callbackOptionalJavaScript function name for a JSONP response.
fieldsOptionalComma-separated list (no spaces) of the fields to return. Default: all fields of the endpoint.
fromRequiredSource zone name or abbreviation.
toRequiredDestination zone name or abbreviation.
timeOptionalLocal Unix time in the source zone. Default: now.

Response

FieldDescription
fromZoneName, fromAbbreviation, fromTimestampSource zone, its abbreviation and the source local time.
toZoneName, toAbbreviation, toTimestampDestination zone, its abbreviation and the destination local time.
toFormattedDestination local time formatted as YYYY-MM-DD HH:mm:ss (only when requested through fields).
offsetDifference 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}