Weeks between two dates
January 1 to February 15, 2024 is 45 days: 6 whole weeks and 3 days left over. Enter any two dates to get the same split, handy for probation periods, notice windows, sprints or training cohorts. 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-01
- End
- 2024-02-15
- Jdn start
- 2,460,311
- Jdn end
- 2,460,356
- Signed days
- 45
- Total days
- 45
Knowing how many full weeks separate two calendar days is a daily need in project planning, payroll cycles, sports seasons, academic terms, and personal milestones. People search for a weeks-between-two-dates calculator when they want a clear split into complete seven-day blocks and a remainder measured in days, not a raw total that still has to be divided by hand. This tool accepts two strict ISO dates in year-month-day form, validates that each day truly exists on the Gregorian calendar including leap-year Februaries, converts both to astronomical Julian Day Numbers with a pure integer formula, and reports the absolute span as whole weeks and leftover days from zero through six. Order does not change the headline week count: the same pair yields the same weeks and leftover whether you list the earlier day first or second, while signed day direction remains available for chronological pipelines. Impossible bases such as the twenty-ninth of February in a common year fail with a clear validation error instead of wrapping silently.
How whole weeks and leftover days are computed
Begin with two civil calendar dates written as year, month, and day in the international ISO form with hyphens and fixed widths so every client agrees on the same six integers.
For each string confirm that the year lies in a practical Gregorian range from year one through nine thousand nine hundred ninety-nine, that the month is between one and twelve, and that the day exists for that month under Gregorian leap rules: a year is a leap year when it is divisible by four, except that century years are leap years only when they are also divisible by four hundred.
That rule makes February twenty-nine legal in years such as two thousand twenty-four and two thousand, and illegal in two thousand twenty-three and nineteen hundred. When both triples are valid, convert each civil day to an astronomical Julian Day Number with the Fliegel and Van Flandern integer formula used across the date family.
Subtract the two day numbers to obtain a signed day delta, take the absolute value as total calendar days between the two civil midnights, divide by seven with integer floor for whole weeks, and keep the remainder as leftover days between zero and six inclusive.
Where weeks-between calculators show up in real work
Program managers measure sprint capacity and release trains in whole weeks with a remainder that still has to fit into the current calendar block. HR and payroll teams express probation periods, notice windows, and training cohorts as week counts derived from hire and end ISO dates without pulling in a full scheduling library. Data engineers materialize derived columns for retention windows labeled in weeks, cohort age, and campaign length from two ISO strings stored in configuration.
If you later need business-day counts that skip weekends and holidays, pure day addition to a single base, day-of-year ordinals alone, or age from a birth date, treat those as separate search intents and landings rather than overloading this weeks-between-two-dates page.
What you can do with it
Project and sprint planning
Convert a start and end ISO date into whole weeks plus leftover days for capacity planning, release trains, and stakeholder timelines that think in week blocks.
HR probation and notice windows
Express hire-to-end or notice periods as week counts with residual days for contracts, onboarding checklists, and payroll configuration without time-zone drift.
FAQ
What does weeks between two dates mean?
It means the absolute civil-day span between two Gregorian dates, expressed as whole seven-day weeks plus a leftover of zero through six days, without using business-day rules or wall-clock time.
What date format is required?
Strict ISO YYYY-MM-DD with four-digit year and two-digit month and day for both start and end. Values like 2024-1-1 or 2024/01/01 are rejected so every client agrees.
What happens with an invalid date such as 2023-02-29?
The error message explains that the day is not valid for that year and month on the named field.
What does it cost?
The browser tool is free and runs locally.
How many weeks are there from January 1 to February 15, 2024?
There are 6 whole weeks and 3 extra days, 45 days in total. Enter 2024-01-01 and 2024-02-15 and the tool shows both figures, so you do not have to divide by seven yourself.
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/date/weeks-between \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"start":"2024-01-01","end":"2024-02-15"}'const res = await fetch("https://api.kit.forhosting.com/date/weeks-between", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"start": "2024-01-01",
"end": "2024-02-15"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/weeks-between",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"start": "2024-01-01",
"end": "2024-02-15"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/weeks-between", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"start":"2024-01-01","end":"2024-02-15"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"start":"2024-01-01","end":"2024-02-15"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/weeks-between", 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-01",
"end": "2024-02-15"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.weeks_between",
"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
What you send and what you get back
Send two required string fields: start and end, each a strict ISO calendar day such as two thousand twenty-four hyphen zero one hyphen zero one and two thousand twenty-four hyphen zero two hyphen one five. Classic checks include forty-five days from the first of January two thousand twenty-four to the fifteenth of February yielding six whole weeks and three leftover days, exactly fourteen days yielding two weeks and zero leftover, and identical dates yielding zero weeks and zero leftover days with direction same. Missing fields, non-string values, strings that do not match the four-two-two digit pattern, and dates that match the pattern but are not real calendar days all fail with invalid_input and are not charged. On success the response echoes the normalized start and end ISO strings, the Julian Day Number for each side, signed_days as end minus start, total_days as the absolute span, weeks as the floor of total days divided by seven, leftover_days as the remainder modulo seven, a direction flag of forward, backward, or same, and a short formula string that documents the JDN path. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where weeks-between calculators show up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Season length and campaign duration
Measure sports seasons, academic terms, or marketing campaigns as weeks and leftover days from two calendar ISO strings for reports and fixtures.
Technical questions
Does the order of the two dates matter?
No for weeks and leftover_days: the tool uses the absolute day difference. signed_days and direction still show whether end is after, before, or equal to start.