World Time
Get the current time for any location in the world by specifying an IANA timezone identifier. Returns the timezone name, UTC offset, current time, and DST status.
Descripción general
Casos de uso
- World clock widgets
- Scheduling across multiple timezones
- Travel and meeting planner apps
- Display local time for remote team members
Funcionalidades
Full IANA timezone database support (e.g. "America/New_York", "Asia/Tokyo")
UTC offset in standard +HH:MM format
DST detection for the current date
Current time returned in RFC 3339 format
Puntos finales de la API
Get Current Time by Timezone
Returns the current time for the given IANA timezone identifier. The timezone is supplied as a path parameter (e.g. `America/New_York`, `Europe/London`, `UTC`).
GET
https://requiems.xyz/v1/places/time/{timezone}
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| timezone | string |
Obligatorio | IANA timezone identifier (e.g. 'America/New_York', 'Europe/London', 'Asia/Kolkata') |
Pruébalo
Demostración en vivoSolicitud
IANA timezone identifier (e.g. 'America/New_York', 'Europe/London', 'Asia/Kolkata')
Sending request...
Campos de respuesta
| Campo | Tipo | Descripción |
|---|---|---|
| timezone | string |
IANA timezone identifier (e.g. "America/New_York") |
| offset | string |
UTC offset in +HH:MM or -HH:MM format (e.g. '-05:00', '+05:30') |
| current_time | string |
Current time in UTC, formatted as RFC 3339 (e.g. "2024-12-15T14:30:00Z") |
| is_dst | boolean |
Whether the timezone is currently observing daylight saving time |
Ejemplos de código
curl "https://requiems.xyz/v1/places/time/America/New_York" \
-H "requiems-api-key: YOUR_API_KEY"
import requests
url = "https://requiems.xyz/v1/places/time/America/New_York"
headers = {"requiems-api-key": "YOUR_API_KEY"}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch(
'https://requiems.xyz/v1/places/time/America/New_York',
{ headers: { 'requiems-api-key': 'YOUR_API_KEY' } }
);
const data = await response.json();
console.log(data.data.current_time);
require 'net/http'
require 'json'
uri = URI('https://requiems.xyz/v1/places/time/America/New_York')
request = Net::HTTP::Get.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)
puts data['data']['current_time']
Preguntas frecuentes
This API uses IANA timezone identifiers from the standard Time Zone Database (also known as the Olson database). Examples: 'America/New_York', 'Europe/London', 'Asia/Tokyo', 'Pacific/Auckland', 'UTC'. A full list is available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
The API returns a 404 response with an error message indicating the timezone was not found.
Include the full IANA name as the URL path segment. For example, to look up New York time, call GET /v1/places/time/America/New_York — the slash between region and city is part of the URL path.
is_dst indicates whether the timezone is currently observing Daylight Saving Time. For timezones that do not use DST (e.g. UTC, Asia/Tokyo, Africa/Nairobi), this is always false.
current_time is always returned in UTC using the RFC 3339 format (e.g. '2024-12-15T14:30:00Z'). Apply the offset field to convert to local time.