Weekday occurrence in month
Enter a date to learn which occurrence of its weekday it is within the month and whether it is the last: 1 July 2025 is the first Tuesday of July, and not the last. Handy for rules like the second Monday. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2025-07-01
- Weekday
- tuesday
- Weekday number
- 2
- Occurrence in month
- 1
Given a date, report which occurrence of that weekday it is within its month and whether it is the last.
Which Tuesday is it? Reading the occurrence of a date
Many rules and appointments are written as the first Tuesday, the third Thursday or the last Friday of a month. This tool works the other way round: you give it a date, and it tells you which occurrence of its weekday that date is within its month and whether it is the last one. Take 1 July 2025. It is a Tuesday, and since it is the very first day of the month, it is the first Tuesday of July. It is not the last, because more Tuesdays follow later in the month.
Checking dates before you rely on them
The check is useful when a schedule says something like the second Monday or the last Friday and you want to confirm that a given date really matches. A weekday can be the fourth and also the last of its month when no fifth one follows, so read both parts of the answer. The result depends only on the date you enter: nothing is sent over the network, and the same date always gives the same answer. Empty values or entries of the wrong kind are rejected straight away with a clear message instead of a guessed result.
Edge cases and limits
Empty strings, wrong types, and contradictory ranges are rejected early. Civil dates without timezone are calendar dates. Embedded tables travel inside the capability folder with no network calls at runtime.
Review examples before integrating.
What you can do with it
Daily work
Get a reliable answer without a spreadsheet.
FAQ
What does the result tell me?
The weekday of the date, which occurrence of that weekday it is in the month and whether it is the last one. For 1 July 2025 you get Tuesday, first occurrence, not the last.
How do I check that a date is the last Friday of a month?
Enter the date and see whether the result marks it as the last occurrence. If it does, no other Friday follows in that month, so the date is the final Friday.
Can a weekday be both the fourth and the last?
Yes. When a month has only four of that weekday, the fourth one is also the last, and the result marks it as both. Read the two parts of the answer together.
Does the tool need a network connection?
No. The calculation runs in your browser with no network calls, and the same date always gives the same answer, today or years from now.
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/weekday-occurrence \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2025-07-01"}'const res = await fetch("https://api.kit.forhosting.com/date/weekday-occurrence", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2025-07-01"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/weekday-occurrence",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2025-07-01"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/weekday-occurrence", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2025-07-01"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2025-07-01"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/weekday-occurrence", 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": "2025-07-01"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.weekday_occurrence",
"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
How it works
Given a date, report which occurrence of that weekday it is within its month and whether it is the last. The calculation is fully deterministic and runs free in your browser with the same pure function as the API. Inputs are validated before arithmetic so bad types become clear invalid_input errors. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values.
Inputs and outputs
Optional fields use documented defaults. Required schema fields must be present and typed. Success payloads always include the primary output fields so UI bindings stay stable. Extremely large intermediates that overflow IEEE-754 become out-of-range errors rather than nulls. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values.
Edge cases and limits
Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values.
Integration use cases
Automation
Same pure function in widget and API.
Teaching
Stable golden fixtures for demos.
Technical questions
Is it free?
Yes, tier A in the browser.
Network?
No network; parse on-device.
Invalid input?
invalid_input with a clear match.
Stable?
Deterministic goldens freeze the contract.
Author?
samurai.