World Time API guide
How to request current time, timezone, offset, DST, and calendar data from TimeLogic API.
What is a World Time API?
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.
Start with the direct API base URL and a server-side Bearer key:
curl "https://api.timelogicapi.com/v1/time/current?tz=Europe/Paris" \
-H "Authorization: Bearer $TIMELOGIC_API_KEY"
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 | 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 response is projected in UTC. Do not combine selector families; the API returns AMBIGUOUS_TARGET for that request.
What the response contains
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.
Bulk current-time requests
For a world clock or 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.
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.
Related documentation: getting started, selectors, current time endpoint, bulk mode, and pricing.