ForHosting KIT · Dates & time

Weekday of the first of the month from an ISO date

Enter any date and find the weekday on which its month began: 13 August 2026 gives 1 August 2026, a Saturday. You also get the ISO weekday number and a Sunday-based index for laying out calendar grids. 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
Date
2026-08-13
You get
Input date
2026-08-13
First date
2026-08-01
Year
2,026
Month
8

This weekday-of-the-first-of-the-month calculator takes one explicit ISO calendar date and identifies the weekday on which that date's month began. The input day can be anywhere within the month; the result always refers to day one. It returns the canonical first date, the English weekday name, the ISO weekday number, and a Sunday-origin index. Strict Gregorian validation rejects impossible dates instead of silently normalizing them.

Enter a complete and unambiguous ISO date

Provide the date field as a complete ISO calendar date in YYYY-MM-DD form. Four digits identify the year, two identify the month, and two identify the day. A value such as 2026-08-13 therefore selects August 2026, while the final day component proves that the caller supplied an explicit, real calendar date rather than an underspecified month label.

The tool validates the entire value before doing any weekday arithmetic. Months must run from 01 through 12, days must exist within their stated month, and February follows the Gregorian leap-year rule. A year divisible by four is normally a leap year, century years are not, and years divisible by four hundred are leap years after all.

The accepted range is 0001 through 9999, preserving the exact four-digit contract. Datetimes, timezone suffixes, week dates, ordinal dates, relaxed separators, and locale-specific forms are rejected. This strictness prevents values such as 2023-02-29 or 2026-13-01 from being normalized into a different date without the caller noticing.

Understand the deterministic weekday calculation

After validation, the solver keeps the input year and month and deliberately substitutes day one for the weekday calculation. It applies a fixed Gregorian integer formula using a small table of month offsets, adjustments for years divisible by four, corrections for century years, and restoration for years divisible by four hundred. January and February are treated as part of the preceding arithmetic year, which is the standard adjustment used by this formula.

The remainder modulo seven produces a Sunday-origin index: zero means Sunday, one means Monday, and so on through six for Saturday. The response also converts that index to ISO weekday numbering, where Monday is one and Sunday is seven, and selects an English weekday name from a constant table. No system date is constructed at any point.

That matters because many convenient date APIs interpret a date-only string through local timezone rules, which can move midnight across a calendar boundary when code runs in another region. This capability has no such dependency.

Build a monthly calendar grid

Use the weekday index to place day one in the correct column and calculate the leading empty cells in a calendar interface.

Label accounting periods

Add the opening weekday to monthly reports when a selected transaction date identifies the period that needs to be described.

Does the day in my input need to be the first of the month?

No. Any real date in the selected month is accepted. The solver validates that date and computes the weekday for day one of the same month.

Can timezone settings change the answer?

No. The calculation uses Gregorian integer arithmetic and never constructs a Date or reads local timezone settings.

How does the result help me build a monthly calendar?

Use the Sunday-based index to count the empty cells before day one. August 2026 starts on a Saturday, index 6, so a grid that begins on Sunday needs six empty cells first.

What is the difference between the two weekday numbers?

The ISO number runs from Monday as 1 to Sunday as 7. The Sunday-based index runs from Sunday as 0 to Saturday as 6. For a Saturday both happen to be 6.

Does it give the first business day of the month?

No. It only tells you the weekday of day one. It does not skip weekends or holidays, and it does not look for the first occurrence of a chosen weekday.

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/weekday-of-first-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/weekday-of-first-of-month \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"2026-08-13"}'
{
  "date": "2026-08-13"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "date.weekday_of_first_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.

Enter a complete and unambiguous ISO date

Once validation succeeds, the input's day does not affect the answer: every valid date within the same month produces the same first_date and weekday fields.

Understand the deterministic weekday calculation

The same input is governed only by the proleptic Gregorian calendar, so it produces identical output in UTC, in a browser configured for another timezone, and in repeat API calls years later.

Use the result in calendars, schedules, and tests

Calendar interfaces can use the index to determine how many leading cells appear before day one. Reporting pipelines can label the opening weekday of each accounting month. The tool does not calculate the first business day, skip holidays, localize weekday names, or return the first occurrence of a requested weekday; those are different calendar questions. It answers one narrow question deterministically: on which weekday did the first day of the month containing this explicit ISO date fall? The response makes both human display and machine integration straightforward. first_date provides the selected month's canonical YYYY-MM-01 value. weekday gives the English name suitable for a simple report, iso_weekday provides the widely used Monday-through-Sunday value from one through seven, and weekday_sunday_zero supports systems whose week arrays begin with Sunday at index zero. The original input_date, year, and month are included so a stored result remains self-describing. Browser execution is available without charge, while automated API requests use the displayed base price of $0.002. Invalid input returns invalid_input, allowing callers to distinguish a bad calendar value from an internal service failure.

Create stable date fixtures

Generate deterministic month-start expectations for tests without reading the host clock, constructing local dates, or setting a timezone.

What does iso_weekday mean?

It follows ISO numbering: Monday is 1, Tuesday is 2, and Sunday is 7. weekday_sunday_zero is also returned for Sunday-first arrays.

What happens if I provide an impossible date?

The request returns invalid_input. This includes invalid months, nonexistent days, year 0000, and February 29 in a non-leap year.

How much does an API request cost?

A successful API request costs $0.002. The same deterministic calculation can also run free in the browser.

Read the full KIT documentation →