Skip to content
Endpoint reference ยท v1

Time Zone Conversion API

Convert a local date/time between IANA zones using the rules that apply on that date.

GET/api/v1/convert

What It Does

Convert a local date/time between IANA zones using the rules that apply on that date.

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

Parameters

NameTypeRequiredDescription
fromstringYesSource IANA timezone.
Example: America/New_York
tostringYesDestination IANA timezone.
Example: Europe/London
datetimestringYesLocal source datetime in ISO-like form.
Example: 2026-09-09T14:00:00

Request Examples

cURL
curl -s 'https://worldclock.to/api/v1/convert?from=America/New_York&to=Europe/London&datetime=2026-09-09T14:00:00'
JavaScript
const response = await fetch("https:\/\/worldclock.to\/api\/v1\/convert?from=America\/New_York&to=Europe\/London&datetime=2026-09-09T14:00:00");
const result = await response.json();
console.log(result.data);
PHP
$response = wp_remote_get('https://worldclock.to/api/v1/convert?from=America/New_York&to=Europe/London&datetime=2026-09-09T14:00:00');
 = json_decode(wp_remote_retrieve_body(), true);
Python
import requests

response = requests.get("https:\/\/worldclock.to\/api\/v1\/convert?from=America\/New_York&to=Europe\/London&datetime=2026-09-09T14:00:00")
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": {
        "original_datetime": "2026-09-09T14:00:00-04:00",
        "source_timezone": "America/New_York",
        "source_utc_offset": "-04:00",
        "source_dst": true,
        "converted_datetime": "2026-09-09T19:00:00+01:00",
        "destination_timezone": "Europe/London",
        "destination_utc_offset": "+01:00",
        "destination_dst": true,
        "date_rollover_days": 0,
        "unix": 1788976800
    },
    "meta": {
        "version": "v1",
        "timestamp": 1788976800
    }
}

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.original_datetimeSource local datetime with its resolved UTC offset.
data.source_timezoneSource IANA timezone.
data.source_utc_offsetOffset used at the requested source date/time.
data.source_abbreviationSource timezone abbreviation at the requested instant.
data.source_dstWhether source DST is active at that date/time.
data.converted_datetimeEquivalent local datetime in the destination zone.
data.destination_timezoneDestination IANA timezone.
data.destination_utc_offsetDestination offset at the converted instant.
data.destination_abbreviationDestination timezone abbreviation at the converted instant.
data.destination_dstWhether destination DST is active at that instant.
data.date_rollover_daysCalendar-day change between source and destination local dates.
data.unixUnix timestamp shared by both representations.

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