A quantity of elapsed time, represented as a value (e.g. 30.5) and unit (e.g. min).
value
30.5
unit
min
The value of this duration.
Returns Int if possible and Float otherwise.
Int
Float
Facts:
1.min.value == 1 2.2.h.value == 2.2
An ISO 8601 representation of this duration.
The ISO representation has the format [-]PT{hours}H{minutes}M{seconds}S, where
[-]PT{hours}H{minutes}M{seconds}S
{hours}
{minutes}
{seconds}
.
PT0S
1.5.h.isoString == "PT1H30M" -1.5.h.isoString == "-PT1H30M" 1.23.s.isoString == "PT1.23S" 0.ms.isoString == "PT0S"
The unit of this duration.
1.min.unit == "min" 2.2.h.unit == "h"
Tells if this duration has a value of zero or greater.
2.min.isPositive !(-2.min.isPositive)
Returns the class of this.
this
Returns a string representation of this.
This method is used to convert the values of string interpolation expressions to strings.
Returns this |> transform if this is non-null, and null otherwise.
this |> transform
null
This method is the complement of the ?? operator and the equivalent of an Option type's map and flatMap methods.
??
Option
map
flatMap
Tells if this duration is greater than or equal to start and less than or equal to inclusiveEnd.
start
inclusiveEnd
3.min.isBetween(120.s, 4.min) 3.min.isBetween(180.s, 4.min) 3.min.isBetween(120.s, 3.min) !3.min.isBetween(1.min, 2.min)
Returns the equivalent duration with the given unit.
60.min.toUnit("h") == 1.h 1.h.toUnit("min") == 60.min
A quantity of elapsed time, represented as a
value
(e.g.30.5
) andunit
(e.g.min
).