# ISO date weekday

`iso-date-weekday` · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed

ISO-8601 weekday number of a strict YYYY-MM-DD date (Monday=1 ... Sunday=7).

**Use when you need to: iso date weekday · day of week iso · iso weekday number.**

## Supported

- iso date weekday
- day of week iso
- iso weekday number

## Not supported

- locale weekday names
- Sunday-first
- timezones

## Behavior

- Strict YYYY-MM-DD as above. Return weekday 1=Monday .. 7=Sunday.
- Do not return English or other locale names.
- Do not use local Date. Compute from a known civil epoch (proleptic Gregorian 0001-01-01 is Monday, ISO 1).

## Input

- `date` (string, required): min length 10; max length 10

## Output

- `weekday` (integer, required): min 1; max 7

## Limits

- year min: 1
- year max: 9999

## Example

Request input:

```json
{
  "date": "1970-01-01"
}
```

Response:

```json
{
  "result": {
    "weekday": 4
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "iso-date-weekday",
  "version": "1.0.0",
  "input": {
    "date": "1970-01-01"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/iso-date-weekday/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"date":"1970-01-01"}'
```

The machine-readable contract is at [/v1/tools/iso-date-weekday/versions/1.0.0](/v1/tools/iso-date-weekday/versions/1.0.0).

### CLI

```sh
node cli.mjs run iso-date-weekday 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [ISO date day of year](/tools/iso-date-day-of-year): Return the ordinal day number (1-366) of a YYYY-MM-DD date within its calendar year.
- [ISO date from day of year](/tools/iso-date-from-day-of-year): Convert a calendar year and ordinal day number (1-366) to a YYYY-MM-DD date.
- [ISO date last weekday of month](/tools/iso-date-last-weekday-of-month): Return the date of the last occurrence of an ISO weekday within a calendar month.
- [ISO date month end](/tools/iso-date-month-end): Return the last valid calendar day of the year-month of a YYYY-MM-DD date.
- [ISO date month start](/tools/iso-date-month-start): Return the first calendar day of the year-month of a YYYY-MM-DD date.
- [ISO date nth weekday of month](/tools/iso-date-nth-weekday-of-month): Return the date of the nth occurrence of an ISO weekday within a calendar month.
