World Time API guide: get the current time for any timezone
Get the current time for any IANA timezone, IP address, coordinates or UTC offset as JSON: Unix, UTC, local ISO 8601, RFC 2822 and weekday in one call.
Updated
Short answer: call GET /v1/time/current with one location selector and a Bearer key. TimeLogic API answers with the current time for that place as JSON: Unix seconds and milliseconds, UTC, local ISO 8601, RFC 2822, weekday fields and the canonical IANA timezone.
curl "https://api.timelogicapi.com/v1/time/current?tz=Europe/Paris" \
-H "Authorization: Bearer $TIMELOGIC_API_KEY"
What is a World Time API?
A world time API (also called a current time API or local time API) returns the time somewhere in the world over HTTP, so your application does not depend on the clock of the device it runs on. TimeLogic API returns current, timezone-aware JSON for applications that need a dependable server-side clock. It accepts an IANA timezone, an IP address, latitude and longitude, or a fixed UTC offset. The same contract also covers conversion, calendar fields, daylight saving status, business-day calculations, and signed responses.
It is a REST time API and a JSON time API built as a time API for developers: one request, one predictable response shape, and a free plan for trying it, which makes it a practical free world time API for prototypes and small projects.
How do I choose a location selector?
Use one selector family per request. A selector family can contain a comma-separated list when you need bulk results.
| Need | Parameters | Example |
|---|---|---|
| Named IANA zone (current time by timezone API) | tz | tz=Europe/Paris |
| IP-derived zone | ip | ip=8.8.8.8 |
| Coordinate-derived zone | lat and lon | lat=48.8566&lon=2.3522 |
| Fixed offset | offset | offset=%2B02:00 |
If no selector is supplied, the current-time response is projected in UTC. Do not combine selector families; the API returns AMBIGUOUS_TARGET for that request. More detail on each selector is in the time zone API guide.
What does the response contain?
The current-time response includes the Unix timestamp in seconds and milliseconds, UTC and local ISO values, RFC 2822 text, a human-readable label, weekday fields, and the resolved timezone. Use unix_ms for machine comparisons, utc for a canonical instant, and iso_local or human only for display.
{
"unix": 1786054569,
"unix_ms": 1786054569741,
"utc": "2026-08-06T22:16:09Z",
"iso_local": "2026-08-06T18:16:09-04:00",
"rfc2822": "Thu, 06 Aug 2026 18:16:09 -0400",
"human": "August 6, 2026, 6:16 PM America/New_York",
"day_number": 5,
"day_short": "Thu",
"day_full": "Thursday",
"timezone": "America/New_York"
}
How do I build a world clock with one request?
For a world clock API use case or a dashboard, pass comma-separated values within one selector family:
GET /v1/time/current?tz=Europe/Paris,Asia/Tokyo,America/New_York
The returned array follows the input order. Keep the selector family consistent and render each item with its returned timezone rather than assuming the requested label was accepted unchanged. Limits and error handling for lists are in the bulk time API guide.
Integration checklist
- Store the Bearer key in a server environment variable such as
TIMELOGIC_API_KEY. - Choose the most explicit selector available. Coordinates or an IANA zone are preferable when the user has selected a location; IP is useful as a default.
- Treat the response as JSON data and use machine fields for logic.
- Handle
400 INVALID_PARAMETERand400 AMBIGUOUS_TARGETas input errors, not transient network failures.
What else does the time API do with the same key?
The current-time endpoint is one part of a complete time API. The same key and the same selectors work across every endpoint:
- Timezone lookup: canonical IANA zone, offset and DST flag from a zone name, IP address or coordinates.
- Time zone conversion: Unix, Unix-millisecond and ISO 8601 timestamps converted to any zone, with strftime formatting.
- Daylight saving time: whether DST is active and when the next offset change happens.
- Business days and holidays: working days between two dates with holiday calendars for 249 countries.
- Date math, date differences, calendar fields and ISO week numbers and countdowns.
- Embeddable clocks: a live analog or digital clock snippet for any zone.
- Bulk requests: up to 10 zones, IPs or offsets in one call.
- Signed responses: Ed25519 signatures that turn any answer into a verifiable timestamp.
- SDKs for 10 languages and the OpenAPI contract.
Migrating from worldtimeapi.org?
worldtimeapi.org is offline. TimeLogic serves its paths unchanged, for example https://api.timelogicapi.com/api/timezone/Europe/London, with the same JSON fields and .txt output. You can try each route of the WorldTimeAPI-compatible API in the interactive reference, and the WorldTimeAPI alternative guide explains the switch.
Related guides and documentation
- Timezone API guide: resolve zones from names, IPs and coordinates.
- Time zone conversion API guide: convert any timestamp between zones.
- Daylight saving time API guide: DST status and the next transition.
- Business days and holiday API guide: working days across 249 countries.
- Signed API responses: verify responses with Ed25519.
- Docs: getting started, selectors, bulk mode, the current time endpoint, and pricing.
- Use it from your stack: JavaScript, Python, ESP32 and Arduino, Raspberry Pi and MicroPython.
- NTP vs a time API: which source of time your project needs.
- Time API comparison: TimeLogic next to other time and time zone APIs.
- Migrate from WorldTimeAPI: code changes for ten languages.
Frequently asked questions
What is a world time API?
A world time API is an HTTP service that returns the current date and time for a place you name. TimeLogic API returns it as JSON for an IANA timezone, an IP address, latitude and longitude, or a fixed UTC offset, including Unix seconds and milliseconds, UTC and local ISO 8601 values, RFC 2822 text, weekday fields and the resolved timezone.
What is a time API?
A time API answers questions about time over HTTP so your code does not rely on the device clock. TimeLogic API covers the current time, time zone lookup by name, IP or coordinates, time zone conversion, daylight saving status, date math, calendar fields, countdowns, business days with holiday calendars, embeddable clocks and signed responses, all with one API key.
Is there a free world time API?
Yes. TimeLogic API's Free plan includes 10,000 requests per month and needs no credit card. Paid plans raise the monthly quota; the endpoints are the same on every plan.
How do I get the current time for a timezone?
Send GET https://api.timelogicapi.com/v1/time/current?tz=Europe/Paris with your API key in an Authorization: Bearer header. The response contains unix, unix_ms, utc, iso_local, rfc2822, human, weekday fields and timezone.
Can I get the time for several timezones in one request?
Yes. Pass up to 10 comma-separated values in one selector family, for example tz=Europe/Paris,Asia/Tokyo,America/New_York. The response is an array in the same order as the input.
What happens if I do not send a timezone?
With no selector, the current-time response is projected in UTC. Combining selector families, such as tz and ip in one request, returns 400 AMBIGUOUS_TARGET.
I used worldtimeapi.org. Do I have to rewrite my code?
No. TimeLogic also serves the worldtimeapi.org paths, such as /api/timezone/Europe/London and /api/ip, with the same response fields and .txt variants. Change the host to api.timelogicapi.com and add your API key.