OxL Reference

method Date.plusYears

The date n years later.

Example:

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

fn main() io {
  print("{Date.of(2028, 2, 29)!.plusYears(1).toIso()}")
}
Output
2029-02-28
pub(api) fn plusYears(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:1458

See also