api
Libur Nasional

Documentation

Endpoint

GET https://api.i-as.dev/api/worldclock

Parameters

  • city (optional): The name of the city for which you want to retrieve the time. If this parameter is provided, the API will return the current time for the specified city.

Example Request

To retrieve the current time of a specific city, pass the city name as a query parameter.

https://api.i-as.dev/api/worldclock?city=New York

Response Format

The API returns a JSON object containing an array of world clock data, with each object representing a city and its corresponding time.

{
  "worldclock": [
    {
      "city": "New York",
      "time": "2025-01-26T12:00:00"
    },
    {
      "city": "London",
      "time": "2025-01-26T17:00:00"
    }
    // More data
  ]
}

Fields in Response:

  • city: The name of the city.
  • time: The current time in the specified city, formatted in ISO 8601.

Example Response:

{
  "worldclock": [
    {
      "city": "New York",
      "time": "2025-01-26T12:00:00"
    },
    {
      "city": "London",
      "time": "2025-01-26T17:00:00"
    }
  ]
}

This API allows you to quickly retrieve the current time in various cities around the world. By using the optional city parameter, you can filter the response to get the time for a specific city.