years

val Int.years: Duration

Returns a Duration equal to this Int number of years.

Example:

2.years // 730.days

Since

1.1.0


val Long.years: Duration

Returns a Duration equal to this Long number of years.

Example:

2L.years // 730.days

Since

1.1.0


val Double.years: Duration

Returns a Duration equal to this Double number of years.

Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.

Example:

2.0.years // 730.days

Since

1.1.0

Throws

IllegalArgumentException

if this Double value is NaN.