Week start and end dates
Enter one day and get the first and last day of its week: Wednesday 3 January 2024 sits in the week from Monday 1 to Sunday 7 January. Weeks start on Monday by default, or on Sunday or any other day you choose. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2024-01-03
- First weekday
- monday
- First weekday index
- 1
- Weekday
- wednesday
- Weekday index
- 3
- Days from start
- 2
Finding the first and last calendar day of the week that contains a given date is a common need in timesheets, sprint boards, school calendars, payroll periods, and reporting dashboards. People search for a week-start-and-end calculator when they already know one day inside the week and need the full Monday-through-Sunday or Sunday-through-Saturday span without counting on their fingers. This tool accepts a strict ISO calendar date in year-month-day form, optional first-weekday setting (default Monday for ISO-style weeks, or Sunday for US-style weeks), validates that the day truly exists on the Gregorian calendar including leap-year Februaries, computes the weekday with Sakamoto’s method, and returns the inclusive week start and end as ISO strings plus Julian Day Numbers and the offset from the week start. Impossible bases such as the twenty-ninth of February in a common year fail with a clear validation error instead of wrapping silently.
How week start and end are computed
Begin with one civil calendar date written as year, month, and day in the international ISO form with hyphens and fixed widths so every client agrees on the same three integers.
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. Next resolve the first-weekday setting: English names sunday through saturday or numeric indices zero through six with Sunday equal to zero and Monday equal to one, defaulting to Monday when omitted so ISO-style weeks are the common path. Compute the weekday of the given date with Sakamoto’s integer method, which never consults the host clock.
Convert the civil day to an astronomical Julian Day Number with the Fliegel and Van Flandern formula, subtract the modular offset that is the number of days since the configured week start, and add six to obtain the inclusive week end. Inverse Julian conversion yields the civil start and end ISO strings.
Where week-boundary calculators show up in real work
Program managers and scrum masters map any mid-sprint day to the Monday–Sunday or custom first-weekday block that owns it for capacity boards and burndown charts. HR and payroll teams convert a worked day into the pay week that contains it without pulling a full scheduling library or depending on server locale. Teachers and school administrators turn any class day into the week start and end for attendance sheets and parent communications.
Analytics engineers materialize week-bucket keys for dashboards so events are grouped by civil week start rather than by arbitrary host-time truncations that shift under daylight saving. If you later need whole weeks between two dates, weekend day counts inside a range, the nth weekday of a month, or pure day addition to a single base, treat those as separate search intents and landings rather than overloading this week-start-and-end-dates page.
What you can do with it
Sprint and timesheet week bounds
Map any mid-week work date to the inclusive Monday–Sunday or Sunday–Saturday range for timesheets, sprint boards, and capacity reports without host time-zone drift.
Payroll and attendance periods
Convert a worked or class day into the week start and end ISO strings used by payroll cycles, school attendance sheets, and parent-facing calendars.
FAQ
What does week start and end dates mean?
It means the inclusive first and last civil calendar days of the seven-day week that contains your date, according to a first-weekday setting such as Monday or Sunday, 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. Values like 2024-1-3 or 2024/01/03 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 date field.
What does it cost?
The browser tool is free and runs locally.
Which day does the week start on by default?
Monday, as in ISO-style weeks. Choose Sunday for US-style weeks or any other weekday, and the week returned always has seven days and contains the date you entered.
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/week-start-end \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2024-01-03"}'const res = await fetch("https://api.kit.forhosting.com/date/week-start-end", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-01-03"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/week-start-end",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2024-01-03"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/week-start-end", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2024-01-03"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2024-01-03"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/week-start-end", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"date": "2024-01-03"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.week_start_end",
"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 a required string field date as a strict ISO calendar day such as two thousand twenty-four hyphen zero one hyphen zero three, and an optional first_weekday such as monday or sunday or a zero-through-six index. Missing date, non-string values, strings that do not match the four-two-two digit pattern, dates that match the pattern but are not real calendar days, and unknown weekday tokens all fail with invalid_input and are not charged. On success the response echoes the normalized date, the resolved first_weekday name and index, the weekday name and index of the input day, days_from_start as the offset zero through six from the week start, week_start and week_end as inclusive ISO strings, Julian Day Numbers for the input and both boundaries, length_days always seven, and a short formula string that documents the Sakamoto and JDN path. Classic checks include Wednesday the third of January two thousand twenty-four with Monday-first weeks yielding the first through the seventh of January, the same date with Sunday-first weeks yielding the thirty-first of December two thousand twenty-three through the sixth of January two thousand twenty-four, and an input that is already the first weekday returning that day as week_start with days_from_start zero. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where week-boundary 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
Analytics week-bucket keys
Derive stable civil week_start keys for event grouping and cohort dashboards so buckets follow the same first-weekday rule in every environment.
Technical questions
What is the default first weekday?
Monday, matching common ISO-style weeks. Pass first_weekday as sunday (or 0) for US-style weeks, or any other weekday name or 0–6 index.