Duration.Get(ITemporalUnit) Method

Definition

Gets the value of the requested unit.

[Android.Runtime.Register("get", "(Ljava/time/temporal/TemporalUnit;)J", "", ApiSince=26)]
public long Get(Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("get", "(Ljava/time/temporal/TemporalUnit;)J", "", ApiSince=26)>]
abstract member Get : Java.Time.Temporal.ITemporalUnit -> int64
override this.Get : Java.Time.Temporal.ITemporalUnit -> int64

Parameters

unit
ITemporalUnit

the TemporalUnit for which to return the value

Returns

the long value of the unit

Implements

Attributes

Remarks

Gets the value of the requested unit. This returns a value for each of the two supported units, SECONDS and NANOS. All other units throw an exception.

Java reference for java.time.Duration.get.

Applies to