Get current time
GET /v1/time/currentOpenAPI YAMLResolve the precise current time for any timezone, IP, coordinate or UTC offset.
What do I need to send?
Choose one target selector: tz, ip, lat + lon, offset, or auto_tz. Omit the selector to use UTC.
format adds a formatted display value. sign adds verification headers.
Rule: Bulk requests use one comma-separated tz, ip, or offset value. Do not mix selector families.
| Name | Needed? | Use it for |
|---|---|---|
tz | Choose one target | IANA timezone, e.g. Europe/Paris. Comma-separated values enable bulk mode. |
ip | Choose one target | IPv4 or IPv6 address (resolved via GeoLite2). Comma-separated for bulk. |
lat | Pair parameter | Latitude in decimal degrees. Pair with lon. |
lon | Pair parameter | Longitude in decimal degrees. Pair with lat. |
offset | Choose one target | Fixed UTC offset, URL-encoded e.g. %2B02:00 for +02:00. Comma-separated for bulk. |
auto_tz | Choose one target | Set true to use the request IP's timezone from Cloudflare metadata. |
format | Optional | strftime pattern for an additional `formatted` field, e.g. %Y-%m-%d %H:%M:%S. |
sign | Optional | Set true to receive a signed response (Ed25519 headers). |
Code samples
Copy a request in your preferred language and replace YOUR_TIMELOGIC_API_KEY with your direct API key.
curl "https://api.timelogicapi.com/v1/time/current?tz=Europe/Paris" \
-H "Authorization: Bearer $TIMELOGIC_API_KEY"Example response
{
"unix": 1778093048,
"unix_ms": 1778093048881,
"utc": "2026-05-06T18:44:08Z",
"iso_local": "2026-05-06T20:44:08+02:00",
"rfc2822": "Wed, 06 May 2026 20:44:08 +0200",
"human": "May 6, 2026, 8:44 PM Europe/Paris",
"day_number": 4,
"day_short": "Wed",
"day_full": "Wednesday",
"timezone": "Europe/Paris"
}
Additional endpoint notes
Use at most one selector family (tz, ip, lat+lon, offset, or auto_tz=true) per request. If no selector is provided, the response is in UTC with "iso_local": null and "timezone": null. An offset target also returns "timezone": null, with a human label such as UTC+02:00. Mixing selector families returns 400 AMBIGUOUS_TARGET.
curl "https://api.timelogicapi.com/v1/time/current?tz=Europe/Paris" \
-H "Authorization: Bearer $TIMELOGIC_API_KEY"
Bulk mode: pass a comma-separated list (up to 10 values) to one selector to receive an array, in input order. Any comma, even a trailing one, returns an array. Failed items appear in place as { "item", "error", "request_id" } while the response is still HTTP 200 (see Bulk mode):
GET /v1/time/current?tz=Europe/Paris,Asia/Tokyo,America/New_York
Common errors
400 INVALID_PARAMETER— invalid IANA timezone (e.g.tz=Not/AZone) or malformed offset. Use%2Bto URL-encode+.400 AMBIGUOUS_TARGET— multiple selector families in the same request.404 NOT_FOUND— anipwith no timezone mapping (private or reserved addresses such as10.0.0.1).
When to use this endpoint
Use Get current time when an application needs a canonical "now" value for a single place or for a batch of places. It is the best fit for dashboards, scheduling previews, user profile defaults, countdowns, and systems that need a server-side timestamp rather than a browser clock.
Request model
Choose one selector family per request: tz, ip, lat + lon, offset, or auto_tz=true. Bulk requests use a comma-separated list inside the same family, which keeps validation predictable and preserves the response order for the caller.
Response notes
The response includes Unix seconds, Unix milliseconds, UTC, local ISO 8601, RFC 2822, human-readable text, day fields, and the resolved timezone. day_number counts from Sunday (1 = Sunday … 7 = Saturday). timezone is the canonical zone, which can differ from the name you sent (Europe/Stockholm returns Europe/Berlin). Prefer unix_ms for ordering events and iso_local for display. For browser and Node.js code that calls this current time API and keeps a clock offset, see the JavaScript guide.
Frequently asked questions
How do I get the current time for a timezone with an API?
Call GET /v1/time/current?tz=Europe/Paris on https://api.timelogicapi.com with your API key. The JSON response carries Unix seconds and milliseconds, the UTC instant, the local ISO 8601 time with its offset, RFC 2822, a readable label and the weekday.
Can I get the current time from an IP address or coordinates?
Yes. Use ip= for an IP address, or lat= and lon= for coordinates, instead of tz=. Use one selector family per request; mixing them returns 400 AMBIGUOUS_TARGET.
How do I format the time with strftime?
Add format= with a URL-encoded strftime pattern, for example format=%25Y-%25m-%25d. The response gains a formatted field next to the standard fields.
Can I get the time for several time zones at once?
Yes. Pass up to 10 comma-separated values to one selector, for example tz=Europe/Paris,Asia/Tokyo, and the response is an array in input order.