The built-in type
Year represents years.
toInt : Year -> Int¶
Maps a year to its representation as an integer.
val a = Year::toInt (Year::fromInt 2021) // = 2021
fromInt : Int -> Year¶
Constructs a year from its integer representation. Valid range is -999999999 to 999999999. Year numbers outside this range results in an error.
isLeapYear : Year -> Boolean¶
Checks whether a year is a leap year.
val leap2000 = Year::isLeapYear (Year::fromInt 2000) // = True val leap2013 = Year::isLeapYear (Year::fromInt 2013) // = False