Utilities🌐 YAS server-sideAPI availablebeginner
Date Difference
Computes the difference between two dates in days, hours and minutes.
Processed by YAS · not stored
Ready to runInstant execution
Result
—What does this tool do?
Computes the difference between two dates in days, hours and minutes.
Why would I use it?
- You are planning deadlines or countdowns.
- You want to know how much time passed between events.
- You are calculating billing or SLA periods.
Real-life example
Input
2026-08-01 → 2026-08-12
Output
11 days, 0 hours, 0 minutes
Both dates are parsed from many formats.
Input → Process → Output → Next
- Input
- Enter two dates.
- Process
- YAS computes the span.
- Output
- Difference in days/hours/minutes.
- Next action
- Use the span for planning.
Common mistakes
- Assuming inclusive counting (the tool counts elapsed time).
- Timezone confusion when entering datetimes.
- Entering dates in the wrong order (negative results).
What the result means
The output is the elapsed time between the two instants.
Privacy & security
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
API
Endpoint
POST https://yas.sh/api/v1/tools/date-difference
Request Header
Content-Type: application/json
cURL
curl -X POST "https://yas.sh/api/v1/tools/date-difference" \
-H "Content-Type: application/json" \
-d '{"a":"2026-01-01","b":"2026-08-08"}'JavaScript
const res = await fetch("https://yas.sh/api/v1/tools/date-difference", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"a": "2026-01-01",
"b": "2026-08-08"
}),
});
const data = await res.json();Python
import requests
r = requests.post("https://yas.sh/api/v1/tools/date-difference", json={"a":"2026-01-01","b":"2026-08-08"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| a | string | Yes | Date 1 (ISO or unix seconds) |
| b | string | Yes | Date 2 (ISO or unix seconds) |
Success response
{ "result": { "milliseconds": ..., "days": 219, "weeks": 31, "businessDays": 156, "yearsApprox": 0.6 } }Difference between two dates: years/months/days/hours/minutes/seconds + business days.
Error responses
400 VALIDATION_ERROR— invalid input or unsupported option.413 PAYLOAD_TOO_LARGE— input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED— rate limit exceeded (60 req/min).
Limits
- Maximum input: 64 KB per request.
- Rate limit: 60 requests/min per IP address.
- Authenticated accounts benefit from higher tier quotas.
Related tools