ForHosting KIT · Dates & time

Nth weekday of the month

The third Monday of March 2024 is the 18th, and the last Friday of February 2024 is the 23rd. Pick a year, a month, a weekday and first to fifth or last to date rules like Thanksgiving or a monthly meeting. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Year
2,024
Month
3
Target weekday
monday
Ordinal
3
You get
Weekday index
1
Ordinal index
3
Day
18
Date
2024-03-18

Meeting schedules, payroll calendars, public holidays, and recurring social events are often defined as the second Tuesday or the last Friday of a named month rather than as a fixed day number. Translating that human rule into a concrete Gregorian date requires knowing which weekdays fall inside the month, how leap years stretch February, and whether a fifth occurrence actually fits before the month ends. This calculator accepts a year, a month from one to twelve, a weekday name or zero-based index, and an ordinal from first through fifth or last, then returns the civil ISO date of that occurrence.

How the nth weekday of a month is resolved without a clock

Start with four pieces of intent: a Gregorian year in the practical range one through nine thousand nine hundred ninety-nine, a month numbered one for January through twelve for December, a target weekday, and an ordinal that means first, second, third, fourth, fifth, or last. Confirm leap rules for February with the standard Gregorian test: 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 decides whether February has twenty-eight or twenty-nine days and therefore how many of each weekday can appear. From that first-of-month weekday, the day number of the first matching weekday is one plus the modular distance to the target. Every later occurrence is seven calendar days later.

The count of occurrences is how many times you can add seven without leaving the month length. For last, n is set to the full count so the final matching day of the month is returned. Format the result as a four-two-two ISO string.

Where nth-weekday calendars show up in real work

United States style public holidays such as Thanksgiving (fourth Thursday of November) and Labor Day (first Monday of September) are defined by weekday ordinals rather than fixed day numbers, so payroll and school calendars must resolve them for every year. Corporate all-hands meetings often land on the second Tuesday of each month, and product release trains may ship on the last Friday. Banking and settlement systems encode recurring cutoffs as weekday-in-month rules that must stay stable across leap years and century boundaries.

Data engineers materialize dimension tables of holiday and meeting dates for analytics without pulling a full iCalendar library into a pure function path. If you later need to add an arbitrary number of calendar days to a date, compute day-of-year ordinals, find which quarter a date falls in, or invert the problem and ask which occurrence a given date is, treat those as separate search intents and landings rather than overloading this nth-weekday-of-the-month page.

Public holidays defined by weekday ordinals

Resolve Thanksgiving, Labor Day, Memorial Day, and similar rules into concrete ISO dates for any year without hard-coding tables.

Recurring team meetings and release cadences

Turn “second Tuesday” or “last Friday of the month” policies into calendar dates for invites, CI freezes, and status reports.

Payroll and settlement cutoffs

Materialize weekday-in-month cutoffs for finance pipelines with leap-safe Gregorian math and clear errors when a fifth occurrence is missing.

What does nth weekday of the month mean?

It means the date of the first, second, third, fourth, fifth, or last named weekday inside a given calendar month—for example the third Monday of March 2024 is 2024-03-18.

What happens if the fifth occurrence does not exist?

The error states how many occurrences of that weekday the month actually has.

How do I request the last Friday of a month?

Set weekday to friday (or 5) and ordinal to last (or -1). The response date is the final Friday that still falls inside that month.

Does it handle leap years?

Yes. Gregorian leap rules apply, so February can have twenty-nine days and may contain five of some weekdays.

What does it cost?

The browser tool is free and runs locally.

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.

POSThttps://api.kit.forhosting.com/date/nth-weekday-of-month

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.

curl -X POST https://api.kit.forhosting.com/date/nth-weekday-of-month \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"year":2024,"month":3,"weekday":"monday","ordinal":"3"}'
{
  "year": 2024,
  "month": 3,
  "weekday": "monday",
  "ordinal": "3"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "date.nth_weekday_of_month",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

When the requested slot does not exist—for example a fifth Monday in a month that only contains four Mondays—the request fails with a clear validation error instead of inventing a date in the next month.

How the nth weekday of a month is resolved without a clock

For a numeric ordinal n, the day is the first occurrence plus n minus one times seven, and the request is rejected when n exceeds the count.

What you send and what you get back

Send four required fields: year as a finite integer year, month as an integer from one to twelve, weekday as an English name such as monday or as an integer from zero to six with Sunday equal to zero, and ordinal as one through five, the words first through fifth, or the string last (also accepted as negative one). Classic checks include the third Monday of March two thousand twenty-four landing on the eighteenth, the last Friday of February two thousand twenty-four landing on the twenty-third, and the fifth Thursday of February two thousand twenty-four landing on the twenty-ninth because that leap February has five Thursdays. Missing fields, non-integer years or months, unknown weekday tokens, ordinals outside one through five that are not last, and requests for an occurrence that does not exist in that month all fail with invalid_input and are not charged. On success the response echoes year, month, the normalized weekday name and weekday_index, the ordinal as a number or the string last, ordinal_index as the resolved one-based occurrence number, day of month, the ISO date string, occurrence_count for how many times that weekday appears in the month, is_leap_year for the year, days_in_month, and a short formula string documenting the leap and Sakamoto rules. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where nth-weekday calendars 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.

Read the full KIT documentation →