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
| 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. |
by | Required | zone, position, city or ip. |
zone | by=zone | Time zone name (America/Chicago) or abbreviation (CST). |
lat, lng | by=position | Latitude and longitude in decimal degrees. |
country | by=city | ISO 3166-1 alpha-2 country code. |
city | by=city | City name. * is a wildcard (New*). |
region | Optional (by=city) | Region code (NY) or name to narrow the search. |
ip | Optional (by=ip) | IPv4 or IPv6 address. Default: the address of the caller. |
time | Optional | Unix time (UTC) of reference. Default: now. |
page | Optional | Page of results when a city search matches several places (10 per page). |
Response
| Field | Description |
status | OK or FAILED. |
message | Error message, empty on success. |
countryCode | ISO 3166-1 alpha-2 country code. |
countryName | Country name. |
regionName | Region or state (empty for by=zone). |
cityName | City or place (empty for by=zone). |
zoneName | IANA time zone name. |
abbreviation | Time zone abbreviation in effect. |
gmtOffset | Offset from UTC in seconds. |
dst | "1" when daylight saving time is in effect, "0" otherwise. |
zoneStart | Unix time when the current rule started. |
zoneEnd | Unix 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. |
nextAbbreviation | Abbreviation after the next change (null if none). |
timestamp | Local time as a Unix number (subtract gmtOffset to get UTC). |
formatted | Local time formatted as YYYY-MM-DD HH:mm:ss. |
totalPage, currentPage, zones | Pagination 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>