Misc

Query World Time

0calls
Free

Need to schedule a meeting with someone overseas and wonder what time it is there? Use this endpoint for an instant answer.

GET
uapis.cn
/api/v1/misc/worldtime
Query parameters
1
city
string
required
City or area to look up. Pick a standard IANA time-zone name from the , e.g. `Asia/Shanghai`, `Asia/Tokyo`, `America/New_York`.

Overview

Given a standard time-zone name (e.g. Asia/Shanghai or Europe/London), the endpoint returns the current local time, UTC offset, weekday, and other details for that zone.

Query parameters

city
stringrequired
City or area to look up. Pick a standard IANA time-zone name from the , e.g. `Asia/Shanghai`, `Asia/Tokyo`, `America/New_York`.

Response

200 / OK

Lookup succeeded. Returns detailed time information for the requested time zone.

JSON
{
  "datetime": "2023-10-27T15:30:00.123456+08:00",
  "offset_seconds": 28800,
  "offset_string": "+08:00",
  "query": "Shanghai",
  "timestamp_unix": 1698391800,
  "timezone": "Asia/Shanghai",
  "weekday": "Friday"
}

400 / Bad Request

Invalid request. Please verify that the city parameter was provided.

JSON
{
  "code": "INVALID_ARGUMENT",
  "details": {},
  "message": "Missing 'city' parameter."
}

404 / Not Found

Time zone not found. The provided name does not match a supported time zone. Verify the spelling, or use the standard Continent/City form.

JSON
{
  "code": "NOT_FOUND",
  "details": {},
  "message": "The specified timezone was not found."
}