Date & Time
Date Difference API
Break down the gap between two dates into years, months, days, and totals in days and hours.
Request Headers
| Name | Required | Description |
|---|---|---|
X-RapidAPI-Key | required | Your RapidAPI key. Get one free. |
X-RapidAPI-Host | required | date-diff.p.rapidapi.com |
Endpoints
GET
/v1/time/diff Compute the calendar and total difference between two dates
Parameters
| Name | Type | Required | Default | Constraints |
|---|---|---|---|---|
end | string | required | — | matches \S |
start | string | required | — | matches \S |
Code Examples
curl --request GET \
--url 'https://date-diff.p.rapidapi.com/v1/time/diff?end=example&start=example' \
--header 'x-rapidapi-key: YOUR_API_KEY' \
--header 'x-rapidapi-host: date-diff.p.rapidapi.com' const url = "https://date-diff.p.rapidapi.com/v1/time/diff?end=example&start=example";
const options = {
method: "GET",
headers: {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "date-diff.p.rapidapi.com"
}
};
const response = await fetch(url, options);
const data = await response.json();
console.log(data); import requests
url = "https://date-diff.p.rapidapi.com/v1/time/diff"
querystring = {"end": "example", "start": "example"}
headers = {
"x-rapidapi-key": "YOUR_API_KEY",
"x-rapidapi-host": "date-diff.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params=querystring)
print(response.json()) Interactive Example
$ GET /v1/time/diff?start=2020-01-01&end=2023-03-15
{"years":3,"months":2,"days":14,"total_days":1169,"total_hours":28056} Subscribe & License
Access this API with commercial-ready tiers on RapidAPI. Flexible plans designed for side-projects, startups, and high-volume production architectures.
Developer Support
Need help integrating or have a custom endpoint request? Our engineering team is here to assist with authentication, payload schemas, and high-frequency rate limit increases.
System Performance
Monitored 24/7 with a 99.9% uptime SLA. Built atop cloud-native microservices with globally distributed edge caching to ensure ultra-low latency response times.
All Systems Operational