# ISO date days in month

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

Return the number of calendar days in a given proleptic Gregorian year and month.

**Use when you need to: iso date days in month · days in a calendar month · month length.**

## Supported

- iso date days in month
- days in a calendar month
- month length

## Not supported

- fiscal months
- Julian calendar
- timezones

## Behavior

- year is a JSON integer 1-9999. month is a JSON integer 1-12.
- Returns 28, 29, 30, or 31 depending on the month and whether year is a leap year (February is 29 in leap years, 28 otherwise).

## Input

- `year` (integer, required): min 1; max 9999
- `month` (integer, required): min 1; max 12

## Output

- `days` (integer, required): min 28; max 31

## Limits

- year min: 1
- year max: 9999

## Example

Request input:

```json
{
  "year": 2024,
  "month": 2
}
```

Response:

```json
{
  "result": {
    "days": 29
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "iso-date-days-in-month",
  "version": "1.0.0",
  "input": {
    "year": 2024,
    "month": 2
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/iso-date-days-in-month/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"year":2024,"month":2}'
```

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

### CLI

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

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

## Related tools

- [ISO date age](/tools/iso-date-age): Compute the calendar-aware elapsed years, months, and days between a birth date and an as-of date.
- [ISO date add years](/tools/iso-date-add-years): Add a signed whole-year delta to a YYYY-MM-DD date, clamping the day if 29 February has no match.
- [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.
