OxL Reference

method Date.plusMonths

Calendar months; the day is clamped to the end of a shorter month (01-31 + 1 month = 02-28).

Example:

oxl✓ checked in CI
use std.time { Date }

fn main() io {
  print("{Date.of(2026, 1, 31)!.plusMonths(1).toIso()}")
}
Output
2026-02-28
pub(api) fn plusMonths(n: i64) -> Date

Since. 1.0.0-beta

Parameters

NameType
ni64

Returns

Date

Effects

none declared (pure unless the body says otherwise)

Defined in: std/time/time.oxl:1444

See also