# ISO date range split by month

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

Split an inclusive [start, end] date range into per-calendar-month sub-ranges.

**Use when you need to: iso date range split by month · chunk date range by calendar month · monthly billing periods from range.**

## Supported

- iso date range split by month
- chunk date range by calendar month
- monthly billing periods from range

## Not supported

- fiscal months
- split by week or quarter
- timezones

## Behavior

- start and end are strict YYYY-MM-DD calendar dates with year 0001-9999. start must not be after end.
- The range is split into at most 1200 consecutive sub-ranges, one per calendar month it touches.
- The first sub-range starts at start (not necessarily the 1st). The last sub-range ends at end (not necessarily the month end). Every sub-range in between spans a full calendar month.
- Sub-ranges are contiguous and in ascending order; their union covers exactly [start, end] with no gaps or overlaps.

## Input

- `start` (string, required): min length 10; max length 10; pattern `^\d{4}-\d{2}-\d{2}$`
- `end` (string, required): min length 10; max length 10; pattern `^\d{4}-\d{2}-\d{2}$`

## Output

- `ranges` (array of object, required)

## Limits

- year min: 1
- year max: 9999
- max segments: 1200

## Example

Request input:

```json
{
  "start": "2026-01-20",
  "end": "2026-03-10"
}
```

Response:

```json
{
  "result": {
    "ranges": [
      {
        "start": "2026-01-20",
        "end": "2026-01-31"
      },
      {
        "start": "2026-02-01",
        "end": "2026-02-28"
      },
      {
        "start": "2026-03-01",
        "end": "2026-03-10"
      }
    ]
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "iso-date-range-split-by-month",
  "version": "1.0.0",
  "input": {
    "start": "2026-01-20",
    "end": "2026-03-10"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/iso-date-range-split-by-month/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"start":"2026-01-20","end":"2026-03-10"}'
```

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

### CLI

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

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

## Related tools

- [ISO date add months](/tools/iso-date-add-months): Add a signed month count to a YYYY-MM-DD date, clamping the day to the target month.
- [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 days in month](/tools/iso-date-days-in-month): Return the number of calendar days in a given proleptic Gregorian year and 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 range union](/tools/iso-date-range-union): Merge overlapping or day-adjacent inclusive [start, end] date ranges into the fewest equivalent ranges.
