# ISO date range intersect

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

Compute the intersection of two inclusive [start, end] date ranges.

**Use when you need to: iso date range intersect · overlap of two date ranges · common days between date ranges.**

## Supported

- iso date range intersect
- overlap of two date ranges
- common days between date ranges

## Not supported

- open ranges
- timezones
- datetime ranges
- multi-range intersection

## Behavior

- a and b are each an inclusive [start, end] YYYY-MM-DD date range with year 0001-9999; start must not be after end in either.
- intersection is {start, end} covering the days common to both ranges (max(a.start,b.start) to min(a.end,b.end)) when they overlap, or null when they do not.

## Input

- `a` (object, required)
- `b` (object, required)

## Output

- `intersection` (null or object, required)

## Limits

- year min: 1
- year max: 9999

## Example

Request input:

```json
{
  "a": {
    "start": "2026-01-01",
    "end": "2026-01-10"
  },
  "b": {
    "start": "2026-01-05",
    "end": "2026-01-20"
  }
}
```

Response:

```json
{
  "result": {
    "intersection": {
      "start": "2026-01-05",
      "end": "2026-01-10"
    }
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "iso-date-range-intersect",
  "version": "1.0.0",
  "input": {
    "a": {
      "start": "2026-01-01",
      "end": "2026-01-10"
    },
    "b": {
      "start": "2026-01-05",
      "end": "2026-01-20"
    }
  }
}
```

### HTTP (no key)

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

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

### CLI

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

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

## Related tools

- [ISO date range overlap](/tools/iso-date-range-overlap): Test whether two inclusive [start, end] date ranges share at least one day.
- [ISO date business days count](/tools/iso-date-business-days-count): Count the business days in an inclusive date range, skipping caller-supplied weekend weekdays and holidays.
- [ISO date range list](/tools/iso-date-range-list): Enumerate the dates in an inclusive [start, end] range stepped by a whole number of days.
- [ISO date weekday occurrences in range](/tools/iso-date-weekday-occurrences-in-range): List every date within an inclusive date range that falls on a given ISO weekday.
- [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 difference](/tools/iso-date-difference): Whole days from start to end as a canonical integer string (end - start).
