function addMonthsIso
addMonthsIso(
fromIso: string,
months: number
): string

Add N months to an ISO timestamp, clamping to the last day of the target month. e.g. 2026-01-31 + 1mo → 2026-02-28 Preserves the time component (hour/minute/second/ms). Zero months returns the input with canonical ISO string formatting.

Parameters

fromIso: string
months: number

Return Type

string

Usage

import { addMonthsIso } from "doc.ts";