AnvilJSON utilities

Anvil › Docs › /v1/timezones

List of IANA time zones API with current UTC offsets

Every time zone name the server knows, from Africa/Abidjan to Pacific/Wallis, with the UTC offset each one has right now. Filter with any piece of text to find the exact spelling you need.

In one line: GET /v1/timezones?filter=Australia returns JSON. No key, CORS on, 60 requests a minute.
GET

/v1/timezones

All IANA time zone names with their current offset. Change the values and press Send request to call the live API.

Parameters

NameTypeWhat it doesDefault
filterstringOnly names containing this text—

Example

Request:

GET https://api.oddlathe.com/v1/timezones?filter=Australia

Response (generated by the real code when these docs were last built):

{
 "count": 14,
 "timezones": [
  {
   "name": "Australia/Adelaide",
   "utc_offset": "+10:30"
  },
  {
   "name": "Australia/Brisbane",
   "utc_offset": "+10:00"
  },
  {
   "name": "Australia/Broken_Hill",
   "utc_offset": "+10:30"
  },
  {
   "name": "Australia/Canberra",
   "utc_offset": "+11:00"
  },
  {
   "name": "Australia/Currie",
   "utc_offset": "+11:00"
  },
  {
   "name": "Australia/Darwin",
   "utc_offset": "+09:30"
  },
  {
   "name": "Australia/Eucla",
   "utc_offset": "+08:45"
  },
  {
   "name": "Australia/Hobart",
   "utc_offset": "+11:00"
  },
  {
 …

Code examples

curl
curl 'https://api.oddlathe.com/v1/timezones?filter=Australia'
JavaScript (browser or Node 18+)
const params = new URLSearchParams({
  filter: "Australia"
});
const res = await fetch(`https://api.oddlathe.com/v1/timezones?${params}`);
if (!res.ok) throw new Error((await res.json()).error.message);
const data = await res.json();
console.log(data);
Python (standard library only)
import json, urllib.parse, urllib.request

params = urllib.parse.urlencode({"filter": "Australia"})
url = "https://api.oddlathe.com/v1/timezones?" + params
# Send a User-Agent: the edge network refuses Python's default one.
req = urllib.request.Request(url, headers={"User-Agent": "my-script/1.0"})
with urllib.request.urlopen(req, timeout=10) as r:
    data = json.load(r)
print(data)

When it's useful

  • Populating a time zone picker in a form
  • Validating a zone name before saving it
  • Seeing which zones currently share an offset

Good to know

  • Offsets are for the current moment, so they move when daylight saving starts or ends somewhere.
  • The list comes from the server's IANA tz database (several hundred zones, including legacy aliases).

Errors

Errors are JSON like {"error": {"code": "…", "message": "…"}}. The ones this endpoint can return:

  • bad_param (400): a value is the wrong type or out of range (the message says which)
  • rate_limited (429): over 60 requests a minute; wait for Retry-After seconds

Questions

Why are there several zones with the same offset?

Places that share an offset today may have had different rules in the past, or change on different dates. The zone keeps those histories apart.

Related endpoints

Published · OpenAPI 3.1 spec · Limits and privacy