OpenTZ

get-time-zone

Returns the local time, UTC offset and DST status of a time zone. GET https://opentz.noomad.org/v2.1/get-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.
byRequiredzone, position, city or ip.
zoneby=zoneTime zone name (America/Chicago) or abbreviation (CST).
lat, lngby=positionLatitude and longitude in decimal degrees.
countryby=cityISO 3166-1 alpha-2 country code.
cityby=cityCity name. * is a wildcard (New*).
regionOptional (by=city)Region code (NY) or name to narrow the search.
ipOptional (by=ip)IPv4 or IPv6 address. Default: the address of the caller.
timeOptionalUnix time (UTC) of reference. Default: now.
pageOptionalPage of results when a city search matches several places (10 per page).

Response

FieldDescription
statusOK or FAILED.
messageError message, empty on success.
countryCodeISO 3166-1 alpha-2 country code.
countryNameCountry name.
regionNameRegion or state (empty for by=zone).
cityNameCity or place (empty for by=zone).
zoneNameIANA time zone name.
abbreviationTime zone abbreviation in effect.
gmtOffsetOffset from UTC in seconds.
dst"1" when daylight saving time is in effect, "0" otherwise.
zoneStartUnix time when the current rule started.
zoneEndUnix time of the next rule change (null if none). Like the original, by=zone and by=ip report the last second of the current rule, by=position and by=city the first second of the next one.
nextAbbreviationAbbreviation after the next change (null if none).
timestampLocal time as a Unix number (subtract gmtOffset to get UTC).
formattedLocal time formatted as YYYY-MM-DD HH:mm:ss.
totalPage, currentPage, zonesPagination and list of results when a city search matches several places.

Examples

GET https://opentz.noomad.org/v2.1/get-time-zone?key=YOUR_API_KEY&format=json&by=position&lat=40.689247&lng=-74.044502
{"status":"OK","message":"","countryCode":"US","countryName":"United States","regionName":"New York","cityName":"New York City","zoneName":"America\/New_York","abbreviation":"EDT","gmtOffset":-14400,"dst":"1","zoneStart":1772953200,"zoneEnd":1793512799,"nextAbbreviation":"EST","timestamp":1791526415,"formatted":"2026-10-09 06:13:35"}
GET https://opentz.noomad.org/v2.1/get-time-zone?key=YOUR_API_KEY&format=json&by=city&country=FR&city=Paris&fields=cityName,regionName,zoneName,gmtOffset
{"status":"OK","message":"","totalPage":1,"currentPage":1,"zones":[{"regionName":"Île-de-France","cityName":"Paris","zoneName":"Europe\/Paris","gmtOffset":7200}]}
GET https://opentz.noomad.org/v2.1/get-time-zone?key=YOUR_API_KEY&format=xml&by=ip&ip=8.8.8.8&fields=countryCode,cityName,zoneName
<?xml version="1.0" encoding="UTF-8"?>
<result>
  <status>OK</status>
  <message/>
  <countryCode>US</countryCode>
  <cityName>Mountain View</cityName>
  <zoneName>America/Los_Angeles</zoneName>
</result>