# ISO date age

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

Compute the calendar-aware elapsed years, months, and days between a birth date and an as-of date.

**Use when you need to: iso date age · age in years months days · elapsed calendar time between dates.**

## Supported

- iso date age
- age in years months days
- elapsed calendar time between dates

## Not supported

- negative age
- total days or months as a single unit (use iso-date-difference or iso-date-add-months)
- timezones

## Behavior

- birth_date and as_of_date are strict YYYY-MM-DD proleptic Gregorian UTC calendar dates with year 0001-9999. birth_date must not be after as_of_date.
- total_months is the largest whole-month count m such that birth_date plus m whole months (day clamped to the target month, as in iso-date-add-months) does not exceed as_of_date.
- years = floor(total_months / 12), months = total_months mod 12.
- days is the remaining whole days from (birth_date plus total_months months, clamped) to as_of_date, computed on the civil day serial so it is never negative and never depends on a fixed 28/29/30/31 assumption.
- For a birth date of 29 February, the year is not counted as complete until 1 March in non-leap as_of years (29 February clamps to 28 February when added, so day 1 of March is needed to complete the year).

## Input

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

## Output

- `years` (integer, required): min 0
- `months` (integer, required): min 0; max 11
- `days` (integer, required): min 0; max 30

## Limits

- year min: 1
- year max: 9999

## Example

Request input:

```json
{
  "birth_date": "2020-01-15",
  "as_of_date": "2026-09-15"
}
```

Response:

```json
{
  "result": {
    "years": 6,
    "months": 8,
    "days": 0
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "iso-date-age",
  "version": "1.0.0",
  "input": {
    "birth_date": "2020-01-15",
    "as_of_date": "2026-09-15"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/iso-date-age/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"birth_date":"2020-01-15","as_of_date":"2026-09-15"}'
```

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

### CLI

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

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

## Related tools

- [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 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 difference](/tools/iso-date-difference): Whole days from start to end as a canonical integer string (end - start).
- [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 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.
