Skip to content
Endpoint reference ยท v1

Current Time API

Return the server-synchronised current instant in an IANA timezone, city or country.

GET/api/v1/time

What It Does

Return the server-synchronised current instant in an IANA timezone, city or country.

HTTP method
GET
Authentication
Public read-only; Bearer keys supported
Version
v1

Parameters

NameTypeRequiredDescription
timezonestringNoIANA timezone identifier.
Example: Asia/Karachi
citystringNoCity name or slug from the WorldClock directory.
Example: Karachi
countrystringNoCountry name, slug or two-letter code.
Example: Pakistan
latitudenumberNoLatitude used with longitude to select the nearest bundled city/timezone.
Example: 24.86
longitudenumberNoLongitude used with latitude.
Example: 67.01

Request Examples

cURL
curl -s 'https://worldclock.to/api/v1/time?timezone=Asia/Karachi&city=Karachi&country=Pakistan&latitude=24.86&longitude=67.01'
JavaScript
const response = await fetch("https:\/\/worldclock.to\/api\/v1\/time?timezone=Asia\/Karachi&city=Karachi&country=Pakistan&latitude=24.86&longitude=67.01");
const result = await response.json();
console.log(result.data);
PHP
$response = wp_remote_get('https://worldclock.to/api/v1/time?timezone=Asia/Karachi&city=Karachi&country=Pakistan&latitude=24.86&longitude=67.01');
 = json_decode(wp_remote_retrieve_body(), true);
Python
import requests

response = requests.get("https:\/\/worldclock.to\/api\/v1\/time?timezone=Asia\/Karachi&city=Karachi&country=Pakistan&latitude=24.86&longitude=67.01")
response.raise_for_status()
print(response.json()["data"])

Example Response

The values below illustrate the response shape. Live current-time fields are generated dynamically by the endpoint.

JSON
{
    "success": true,
    "data": {
        "timezone": "Asia/Karachi",
        "utc_offset": "+05:00",
        "abbreviation": "PKT",
        "local_time": "2026-09-09T14:30:00+05:00",
        "date": "2026-09-09",
        "time": "14:30:00",
        "unix": 1788946200,
        "dst": false,
        "city": "Karachi",
        "country": "Pakistan"
    },
    "meta": {
        "version": "v1",
        "timezone": "Asia/Karachi",
        "timestamp": 1788946200
    }
}

Response Properties

Every successful response contains success: true, endpoint-specific data, and a meta object. The table below documents the public fields for this endpoint.

PropertyMeaning
successBoolean indicating whether the request completed successfully.
meta.versionPublished API response version.
meta.timestampUnix timestamp for the API response instant.
meta.timezoneTimezone context used by the response.
meta.rate_limitPer-client fair-use limit and remaining-request information on public transports.
data.timezoneResolved IANA timezone identifier.
data.utc_offsetCurrent UTC offset in ยฑHH:MM form.
data.abbreviationCurrent timezone abbreviation when PHP/IANA provides one.
data.local_timeCurrent local time in ISO 8601 form.
data.dateCurrent local calendar date.
data.timeCurrent local wall-clock time.
data.unixUnix timestamp for the same instant.
data.dstWhether daylight-saving time is active.
data.cityResolved city when a city or coordinates were used.
data.countryResolved country when available.
meta.clock_sourceClock-source description confirming server-synchronised UTC plus IANA timezone rules.

Errors use success: false with a stable machine-readable error code and a safe human-readable message.

Errors & HTTP Status Codes

  • 400 โ€” invalid or missing parameter.
  • 401 โ€” API key required or invalid when key-only access is enabled.
  • 404 โ€” unknown city, country or endpoint.
  • 429 โ€” configured rate limit reached.
  • 503 โ€” API disabled or maintenance mode.

Rate Limits & Caching

Current fair-use configuration is 60 requests per minute and 5000 requests per day. Cache stable directory/calculation responses where appropriate; treat current-time output as point-in-time data.

Related Endpoints