Time Zone API: look up any time zone by name, IP or coordinates
A time zone API that returns the IANA time zone, UTC offset and DST status for a zone name, IP address, latitude/longitude or UTC offset. Free plan with 10,000 requests a month.
Updated
Short answer: TimeLogic's time zone API is one call, GET https://api.timelogicapi.com/v1/timezone, with one selector: tz (an IANA name), ip, lat+lon, or offset. For tz, ip and lat+lon it returns the canonical IANA time zone, the current UTC offset in minutes and a daylight-saving flag. For offset it returns timezone: null and matching_zones, the geographic zones currently at that offset. The Free plan includes 10,000 requests a month, free forever, on all endpoints.
What does this time zone API return?
A request for tz=Europe/Paris returns the zone, the current offset and DST status, plus the local and UTC time in several formats:
{
"unix": 1778093027,
"unix_ms": 1778093027712,
"utc": "2026-05-06T18:43:47Z",
"iso_local": "2026-05-06T20:43:47+02:00",
"rfc2822": "Wed, 06 May 2026 20:43:47 +0200",
"human": "May 6, 2026, 8:43 PM Europe/Paris",
"day_number": 4,
"day_short": "Wed",
"day_full": "Wednesday",
"timezone": "Europe/Paris",
"offset": 120,
"dst": true
}
timezoneis the canonical IANA name. Aliases resolve to their target, soUS/EasternreturnsAmerica/New_York.offsetis the current UTC offset in minutes (120is UTC+02:00).dstistruewhen daylight saving time is in effect right now.
Make your first time zone lookup
Get a free key on the signup page, then call the endpoint from your server. Replace YOUR_TIMELOGIC_API_KEY with your own key.
JavaScript (Node 18+, Deno, Bun or a Worker):
const res = await fetch("https://api.timelogicapi.com/v1/timezone?ip=8.8.8.8", {
headers: { Authorization: "Bearer YOUR_TIMELOGIC_API_KEY" },
});
const zone = await res.json();
console.log(zone.timezone, zone.offset, zone.dst);
Python:
import requests
res = requests.get(
"https://api.timelogicapi.com/v1/timezone",
params={"lat": 48.8566, "lon": 2.3522},
headers={"Authorization": "Bearer YOUR_TIMELOGIC_API_KEY"},
)
zone = res.json()
print(zone["timezone"], zone["offset"], zone["dst"])
Raw HTTP:
GET /v1/timezone?tz=america/new_york HTTP/1.1
Host: api.timelogicapi.com
Authorization: Bearer YOUR_TIMELOGIC_API_KEY
Keep the key on your server. The authentication docs list the other ways to send it.
Which selector should I use?
| Input | Use it when | Notes |
|---|---|---|
tz | The application already has an IANA name | Returns the canonical zone for that name, which can be a different name: links resolve to their target (Europe/Stockholm returns Europe/Berlin, US/Eastern returns America/New_York). Matching is case-insensitive. |
ip | You need a network-based default | IP resolution uses GeoLite2; let the user override the result when precision matters. |
lat + lon | You have an explicit place | Send the pair together. Coordinates at sea return nautical zones such as Etc/GMT+8. |
offset | A rules-based zone is not required | URL-encode a plus sign as %2B. Returns timezone: null plus matching_zones: the geographic zones currently at that offset (UTC and Etc/* are excluded; use tz=UTC for UTC). |
Use one selector family per request (auto_tz=true is also accepted and uses the caller's IP). An invalid IANA name or malformed offset returns INVALID_PARAMETER; combining families returns AMBIGUOUS_TARGET; no selector returns MISSING_TARGET; an IP with no mapping (private or reserved ranges) returns 404 NOT_FOUND.
What you get with TimeLogic
- Free plan: 10,000 requests a month, free forever, all endpoints.
- Paid plans: Starter $5 a month for 250,000 requests, Growth $15 for 1,000,000, Scale $149 for 20,000,000. See pricing.
- Signed JSON responses: add
sign=truefor an Ed25519 signature you can check yourself in the verifier. - WorldTimeAPI-compatible routes: the old worldtimeapi.org paths work unchanged on our host.
- Edge-routed: requests are served from Cloudflare's edge network.
- More than lookups: the same key covers current time, time zone conversion, DST transitions, date differences and bulk requests.
WorldTimeAPI shut down. What now?
worldtimeapi.org was shut down in 2026, and many apps had used it as their free time zone API. TimeLogic answers the same /api/timezone, /api/timezone/{area}/{location} and /api/ip paths, with the same JSON fields and .txt variants. Change the host to api.timelogicapi.com, add an API key, and the rest of your code stays the same. The WorldTimeAPI alternative guide walks through it.
How do I handle city, country, and historical inputs?
The endpoint accepts timezone, IP, coordinate, and fixed-offset selectors. If a form starts with a city or country, resolve that value to coordinates or an IANA name first, then call this endpoint. For a past or future moment, use /v1/time/convert with an explicit timestamp, because /v1/timezone reports the current rules for the resolved zone. See the time zone conversion API guide.
IP or coordinates: which is more accurate?
The same endpoint that serves as a timezone API for zone names and coordinates is also an IP to timezone API: send ip= and you get the address's likely IANA zone back. IP-based location is convenient for onboarding and approximate defaults. Coordinates are a clearer choice when a user has selected a place or when a device may be behind a proxy. In both cases, show the resolved zone and allow a correction rather than silently treating an IP result as a verified address.
Related guides and documentation
- World Time API guide: the current time for any zone, IP or coordinate.
- Daylight saving time API guide: DST status and next transitions.
- Bulk time API guide: resolve up to 10 targets per request.
- WorldTimeAPI alternative: keep
/api/ipand/api/timezoneURLs working. - Docs: selectors documentation and the timezone endpoint reference for the complete contract.
- Get the timezone from an IP address: detect a user's time zone on the server or in the browser.
- Get the timezone from coordinates: latitude and longitude to an IANA zone.
- Time API comparison: how TimeLogic compares with other time and time zone APIs.
Frequently asked questions
What is a time zone API?
A time zone API is a web service that tells your code which time zone applies to a place and what that zone's rules are right now. TimeLogic's GET /v1/timezone takes a zone name, an IP address or latitude/longitude and returns the canonical IANA time zone, the current UTC offset in minutes and whether daylight saving time is in effect. A UTC offset lookup (offset=) returns timezone: null and a matching_zones list instead, because one offset can belong to many zones.
Is there a free time zone API?
Yes. TimeLogic's Free plan includes 10,000 requests a month, is free forever and covers all endpoints, including the timezone lookup. Paid plans are Starter ($5 a month for 250,000 requests), Growth ($15 for 1,000,000) and Scale ($149 for 20,000,000).
How do I get the time zone of an IP address?
Call GET /v1/timezone?ip=8.8.8.8 with your API key. IP resolution uses GeoLite2 data and returns the IANA timezone, current offset and DST flag. Private and reserved ranges have no mapping and return 404 NOT_FOUND.
How do I get the time zone for a latitude and longitude?
Send lat and lon together, for example /v1/timezone?lat=48.8566&lon=2.3522. Coordinates are the better choice when a user has picked a place or may be behind a proxy.
What can I use now that WorldTimeAPI is offline?
TimeLogic serves the worldtimeapi.org paths (/api/timezone, /api/timezone/{area}/{location}, /api/ip and the .txt variants) unchanged on https://api.timelogicapi.com, so existing code only needs a new host and an API key.
Are time zone names case-sensitive?
No. The tz selector matches IANA names in any letter case and returns the canonical name. Links resolve to their target, so Europe/Stockholm returns Europe/Berlin and US/Eastern returns America/New_York.
Can I look up a time zone by city or country?
Not directly. Resolve the city or country to coordinates or an IANA name in your application first, then call the endpoint with lat and lon or tz.
Should I store the IANA name or the UTC offset?
Store the IANA name. An offset alone cannot describe daylight saving rules or historical changes, so later conversions need the zone name.
Can I prove a time zone response was not changed?
Yes. Add sign=true and the response carries an Ed25519 signature over the unchanged JSON body. You can check it against the public key at https://api.timelogicapi.com/.well-known/time-api-public-key or in the browser verifier.