method Date.plusMonths
Calendar months; the day is clamped to the end of a shorter month (01-31 + 1 month = 02-28).
Example:
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) -> DateSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
n | i64 |
Returns
Effects
none declared (pure unless the body says otherwise)
Defined in: std/time/time.oxl:1444