Compartir a través de


IChronoPeriod.Get(ITemporalUnit) Method

Definition

Gets the value of the requested unit.

[Android.Runtime.Register("get", "(Ljava/time/temporal/TemporalUnit;)J", "GetGet_Ljava_time_temporal_TemporalUnit_Handler:Java.Time.Chrono.IChronoPeriodInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public long Get (Java.Time.Temporal.ITemporalUnit? unit);
[<Android.Runtime.Register("get", "(Ljava/time/temporal/TemporalUnit;)J", "GetGet_Ljava_time_temporal_TemporalUnit_Handler:Java.Time.Chrono.IChronoPeriodInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member 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.

The supported units are chronology specific. They will typically be ChronoUnit#YEARS YEARS, ChronoUnit#MONTHS MONTHS and ChronoUnit#DAYS DAYS. Requesting an unsupported unit will throw an exception.

Java documentation for java.time.chrono.ChronoPeriod.get(java.time.temporal.TemporalUnit).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to