Calculate days between dates
From 15 January 2024 to 10 March 2025 there are 420 days, exactly 60 weeks, or 13 calendar months and 23 days. Enter two dates and get all three views, with no time zones involved. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Start
- 2024-01-15
- End
- 2025-03-10
- Direction
- forward
- Signed days
- 420
- Days
- 420
- Weeks
- 60
This date difference calculator measures the interval between two calendar dates without relying on time zones, clock times, or daylight-saving rules. Enter two real dates in YYYY-MM-DD format to receive the exact number of days, the equivalent number of weeks, a whole-week breakdown, and a calendar-month breakdown with remaining days. Results are deterministic for Gregorian dates from year 0001 through 9999. Reversing the dates preserves the same absolute interval and clearly reports that the direction is backward.
Enter two precise calendar dates
Provide the first date in the start field and the second date in the end field, using the strict YYYY-MM-DD pattern. Leading zeros matter: write 2026-07-05, not 2026-7-5. Each value is checked against the Gregorian calendar rather than merely matched as text.
That means April 31 is rejected, February 29 is accepted only in a leap year, and month 13 can never slip into a plausible-looking result. The supported year range is 0001 through 9999. The calculation uses calendar days only, so there is no hidden time of day, local time zone, daylight-saving transition, or UTC conversion.
If the end date follows the start date, direction is forward. If it precedes the start date, direction is backward. Equal dates produce a same direction and zero for every measure.
Interpret calendar months correctly
Months do not all contain the same number of days, so the calculator does not pretend that a month is a fixed thirty-day or average-length unit. The months field counts complete calendar-month advances from the earlier date toward the later date. Choose the field that matches the question: days for deadlines and elapsed time, whole weeks for sprint-sized blocks, and months plus remainder for subscriptions, anniversaries, tenure, or other calendar-based periods.
What you can do with it
Measure a project window
Turn project start and delivery dates into exact days, complete weeks, and a calendar-month breakdown for planning.
Check billing periods
Count complete calendar months and remaining days between service dates without treating every month as thirty days.
Validate date logic
Generate deterministic date-span values for tests, imports, reports, and systems that must reject impossible dates.
FAQ
Are the start and end dates counted inclusively?
No. Days measures elapsed calendar boundaries, so consecutive dates are one day apart.
How are weeks calculated?
A week is exactly seven days. The result includes a decimal value plus complete weeks and leftover days.
How are months calculated?
Months are complete calendar-month advances, followed by the exact number of remaining calendar days.
What happens if I enter the later date first?
You get the same interval in days, weeks and months, and the result says the direction is backward. Equal dates give zero for every measure and a same-day direction, so nothing is hidden.
Do time zones or daylight saving change the result?
No. The count uses calendar days only, with no clock time, local time zone, daylight-saving switch or UTC conversion, so two people anywhere in the world get the same answer for the same dates.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/calc2/date-difference \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"start":"2024-01-15","end":"2025-03-10"}'const res = await fetch("https://api.kit.forhosting.com/calc2/date-difference", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"start": "2024-01-15",
"end": "2025-03-10"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/calc2/date-difference",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"start": "2024-01-15",
"end": "2025-03-10"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/calc2/date-difference", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"start":"2024-01-15","end":"2025-03-10"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"start":"2024-01-15","end":"2025-03-10"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/calc2/date-difference", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"start": "2024-01-15",
"end": "2025-03-10"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "calc2.date_difference",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Enter two precise calendar dates
Aliases such as from and to are accepted for API integrations, while the primary start and end names keep forms and examples easy to understand.
Understand days and weeks in the result
The days field is the absolute number of midnight-to-midnight calendar boundaries separating the dates. The weeks field divides the absolute day count by seven and rounds the displayed numeric value to six decimal places, which is useful for estimates and reporting. No assumption is made about business weeks, weekends, holidays, or inclusive counting. For example, January 1 to January 2 is one day, and a leap day is counted like every other real calendar day. signed_days retains the ordering: it is positive when end is later, negative when end is earlier, and zero when both inputs match. For an exact integer breakdown, whole_weeks gives complete seven-day groups and remaining_days_after_weeks gives the remainder from zero through six. Those two fields always reconstruct the day total with the formula whole_weeks multiplied by seven, plus the remainder.
Interpret calendar months correctly
When the original day does not exist in the target month, the calculation clamps to that month’s final valid day; this gives stable behavior for spans beginning on January 29, 30, or 31. remaining_days_after_months reports the exact calendar days left after those complete months. This pair is a calendar breakdown, while days remains the universal exact distance and weeks remains a seven-day conversion. For reversed input, the month breakdown is computed from the chronologically earlier date so the absolute quantities stay consistent, while direction and signed_days communicate ordering.
Technical questions
What does an API request cost?
Each API request costs $0.002. The browser calculator can run locally for free.
What happens if a date is invalid?
The request fails with invalid_input when either value has the wrong format or is not a real Gregorian date.