api
WorldClock

Documentation

Endpoint

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

Parameters

  • city (optional): The name of the city you want to filter the time for. This will return the current time of the specified city.

Example Request

To get the current time in a specific city, you can pass the city name as a query parameter.

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

Response Format

The API will return 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 provides a quick way to retrieve the current time in different cities worldwide. You can use the optional city parameter to filter for a specific city's time.