Skip to content
Endpoint reference ยท v1

Unix Timestamp API

Convert Unix timestamps, UTC and local ISO 8601 dates.

GET/api/v1/unix

What It Does

Convert Unix timestamps, UTC and local ISO 8601 dates.

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

Parameters

NameTypeRequiredDescription
timestampintegerNoUnix seconds to convert.
Example: 1788946200
datetimestringNoLocal datetime to convert to Unix time.
Example: 2026-09-09T14:30:00
timezonestringNoTimezone for local conversion. Defaults to UTC.
Example: Asia/Karachi

Request Examples

cURL
curl -s 'https://worldclock.to/api/v1/unix?timestamp=1788946200&datetime=2026-09-09T14:30:00&timezone=Asia/Karachi'
JavaScript
const response = await fetch("https:\/\/worldclock.to\/api\/v1\/unix?timestamp=1788946200&datetime=2026-09-09T14:30:00&timezone=Asia\/Karachi");
const result = await response.json();
console.log(result.data);
PHP
$response = wp_remote_get('https://worldclock.to/api/v1/unix?timestamp=1788946200&datetime=2026-09-09T14:30:00&timezone=Asia/Karachi');
 = json_decode(wp_remote_retrieve_body(), true);
Python
import requests

response = requests.get("https:\/\/worldclock.to\/api\/v1\/unix?timestamp=1788946200&datetime=2026-09-09T14:30:00&timezone=Asia\/Karachi")
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": {
        "unix": 1788946200,
        "utc": "2026-09-09T09:30:00+00:00",
        "local": "2026-09-09T14:30:00+05:00",
        "timezone": "Asia/Karachi",
        "utc_offset": "+05:00"
    },
    "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.unixUnix timestamp in seconds since 1970-01-01T00:00:00Z.
data.utcUTC ISO 8601 representation.
data.localEquivalent local ISO 8601 representation.
data.timezoneTimezone used for local output.
data.utc_offsetUTC offset of the local representation.

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