Nth weekday after a date
From Monday 18 March 2024, the first Monday after it is 25 March, not the same day, and the second is 1 April. Pick a date, a weekday and which occurrence you need to turn a recurrence rule into one exact date. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2024-03-15
- Weekday
- Monday
- N
- 3
- Result
- 2024-04-01
- Days after
- 17
- Base weekday
- Friday
- Result weekday
- Monday
This nth weekday after a date calculator turns a precise recurrence rule into one unambiguous calendar date. Provide a real ISO date in YYYY-MM-DD form, choose an English weekday, and enter which future occurrence you want. The search is strictly after the supplied date, so a Monday base with Monday selected returns the following Monday for the first occurrence rather than returning the base itself. All work uses pure proleptic Gregorian integer arithmetic without JavaScript Date, the system clock, locale settings, network calls, or random values. That makes the result stable for UTC-oriented automation, tests, schedules, reports, and data pipelines.
Understand the strict-after recurrence rule
The most important part of this calculator is the word strictly. The supplied ISO date is a boundary and is never eligible to be returned. Imagine the base is 2024-03-18, which is a Monday, and the selected weekday is also Monday.
The first Monday strictly after that boundary is 2024-03-25, not 2024-03-18. The second is 2024-04-01, and each later occurrence advances by exactly seven civil days. When the base weekday differs from the target, the engine first moves forward by the smallest positive number of days that reaches the target.
From a Friday base, the first Monday is three days later; the second is ten days later; the third is seventeen days later. This definition is useful because it avoids an easy off-by-one ambiguity between “on or after” and “after.” The tool treats dates as civil Gregorian days rather than instants with hours, offsets, or daylight-saving transitions.
Consequently, it does not skip weekends or holidays, and it does not reinterpret the date according to a device timezone. If you need an inclusive next-weekday answer, a business-day calendar, or holiday-aware scheduling, use a capability designed for that different rule. Here, every valid request has one exact mathematical answer governed only by the three explicit inputs.
Provide valid date, weekday, and occurrence inputs
Send three required fields named date, weekday, and n. The date must be a string with exactly four year digits, two month digits, and two day digits separated by hyphens. It must also identify a real day in the proleptic Gregorian calendar: 2024-02-29 is valid because 2024 is a leap year, while 2023-02-29 is rejected.
Supported years run from 0001 through 9999, and the result must remain inside that range. The weekday accepts English full names Monday through Sunday and familiar abbreviations such as Mon, Tue, Wed, Thu, Fri, Sat, and Sun without regard to letter case. Numeric weekday indexes and localized weekday names are intentionally rejected so their interpretation cannot vary.
The n field is one-based: one asks for the first matching weekday after the boundary, two asks for the second, and so on. It must be a positive integer no greater than 100000; integer strings are accepted for ordinary form submissions, but fractions, zero, negative values, NaN, Infinity, and unrelated text fail validation. A successful response never silently clamps a value, changes an impossible date, or returns a partial object.
Use deterministic Gregorian arithmetic in automation
Internally, the solver first checks month lengths and Gregorian leap-year rules, including the century exception: years divisible by one hundred are not leap years unless they are also divisible by four hundred. It then converts the accepted civil date into an integer serial day using a closed-form Gregorian transformation. The weekday follows directly from that serial count, with a fixed mapping from Sunday through Saturday.
The offset to the target is calculated modulo seven, but a zero modular distance is replaced with seven to enforce strict-after behavior. Seven times n minus one is added for later occurrences, and the final serial value is converted back to year, month, and day. This route is constant-time even for a large n; it never loops through all intervening dates.
More importantly, it does not construct a JavaScript Date, read the host clock, contact a calendar service, sample randomness, or apply operating-system timezone data. Scheduling systems can materialize the fifth Friday after a cutoff, reporting pipelines can calculate future observation dates, and test suites can build stable recurrence cases without freezing a clock. The result is expressed as an ISO civil date and component integers, not as a timestamp, because the input contains no time or zone.
A downstream system that needs a UTC instant can deliberately attach its own time-of-day convention after receiving this date, avoiding hidden assumptions inside the recurrence calculation itself.
What you can do with it
Schedule a future recurring review
Find the third Friday strictly after a project cutoff and store the resulting ISO date in a planning workflow.
Set observation and reporting dates
Resolve the nth selected weekday after a measurement date for reports, audits, and repeatable data pipelines.
FAQ
Does the base date count if it is already the selected weekday?
No. The calculation is strictly after the base. If both are Monday, the first occurrence is seven days later.
What values can I use for n?
Use a positive one-based integer from 1 through 100000. Fractions, zero, and negative values are rejected.
Does this use my timezone?
No. It operates on Gregorian civil dates with deterministic integer arithmetic and never reads a timezone or system clock.
Are holidays or business days skipped?
No. Every seven-day calendar week counts. Holiday-aware and business-day calculations require a different capability.
How do I find the third Monday after a date?
Enter the date, choose Monday and ask for occurrence 3. From Friday 15 March 2024 the answer is 1 April 2024, which is 17 days later, because the first Monday after it is the 18th.
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/nth-weekday-from-date \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2024-03-15","weekday":"Monday","n":3}'const res = await fetch("https://api.kit.forhosting.com/date/nth-weekday-from-date", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-03-15",
"weekday": "Monday",
"n": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/nth-weekday-from-date",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2024-03-15",
"weekday": "Monday",
"n": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/nth-weekday-from-date", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2024-03-15","weekday":"Monday","n":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2024-03-15","weekday":"Monday","n":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/nth-weekday-from-date", 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-03-15",
"weekday": "Monday",
"n": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.nth_weekday_from_date",
"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
Run it in the browser for free or call the API for $0.002 per successful item.
Understand the strict-after recurrence rule
The response includes the normalized base date, canonical weekday name, requested one-based occurrence, result date, total days after the boundary, base weekday, result components, and a true strictly_after flag.
Provide valid date, weekday, and occurrence inputs
Invalid requests produce invalid_input with a useful message, while a request whose large occurrence would extend beyond 9999-12-31 also fails explicitly. API use costs $0.002 for a successful item, and the same pure solver supports the free browser path, making form experiments and automated calls agree exactly.
Integration use cases
Build stable test fixtures
Generate deterministic future weekday cases without freezing the runtime clock or depending on machine timezone settings.
Technical questions
What does an API request cost?
A successful API item costs $0.002. You can also run the same deterministic solver free in the browser.