OxL Reference

method Period.ofYears

A calendar period of n years.

Example:

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

fn main() io {
  print("{Period.ofYears(2).totalMonths()}")
}
Output
24
pub(api) static fn ofYears(n: i64) -> Period

Since. 1.0.0-beta

Parameters

NameType
ni64

Returns

Period

Effects

none declared (pure unless the body says otherwise)

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

See also