Welcome to the World Clock API documentation! Our API is a powerful and intuitive service designed to meet all your timekeeping requirements across the globe with unmatched accuracy and ease. It offers two core features that can be effortlessly incorporated into your projects:
Current Time Retrieval: Fetch the current time of any nation by supplying the relevant ISO 3166 country code. Ideal for applications that require live time display, or for anyone needing to stay in sync with events or meetings around the world.
Relative Time Calculation: Elevate your time management with the capability to determine the time difference between a given time in one country and the current time in another, all through ISO 3166 country codes. This functionality is perfect for organizing activities across time zones, event planning, or simply for understanding the time gap between different regions.
Dive into global time integration with our World Clock API today and enhance your applicationsโ connectivity and relevance.
get_relative_time_by_country_code
Python Exampleimport requests
url = "https://world-clock3.p.rapidapi.com/Get_Relative_Time"
querystring = {"OriginCountryCode":"GB","OriginTime":"2024-03-26 10:57:23","TargetCountryCode":"FR"}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "world-clock3.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.text())
Example Response:
"2024-03-26 11:57:23"
get_current_time_by_country_code
Python Exampleimport requests
url = "https://world-clock3.p.rapidapi.com/Get_Current_Time"
querystring = {"CountryCode":"GB"}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "world-clock3.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.text())
Example Response:
"2024-03-26 11:00:33"
This revision offers a streamlined and structured overview of your World Clock API, making it easier for developers to understand and implement the features in their applications.