OffsetDateTime.Get(ITemporalField) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the value of the specified field from this date-time as an int.
[Android.Runtime.Register("get", "(Ljava/time/temporal/TemporalField;)I", "", ApiSince=26)]
public int Get(Java.Time.Temporal.ITemporalField? field);
[<Android.Runtime.Register("get", "(Ljava/time/temporal/TemporalField;)I", "", ApiSince=26)>]
abstract member Get : Java.Time.Temporal.ITemporalField -> int
override this.Get : Java.Time.Temporal.ITemporalField -> int
Parameters
- field
- ITemporalField
the field to get, not null
Returns
the value for the field
Implements
- Attributes
Remarks
Gets the value of the specified field from this date-time as an int. This queries this date-time for the value of the specified field. The returned value will always be within the valid range of values for the field. If it is not possible to return the value, because the field is not supported or for some other reason, an exception is thrown. If the field is a ChronoField then the query is implemented here. The supported fields will return valid values based on this date-time, except NANO_OF_DAY, MICRO_OF_DAY, EPOCH_DAY, PROLEPTIC_MONTH and INSTANT_SECONDS which are too large to fit in an int and throw an UnsupportedTemporalTypeException. All other ChronoField instances will throw an UnsupportedTemporalTypeException. If the field is not a ChronoField, then the result of this method is obtained by invoking TemporalField.getFrom(TemporalAccessor) passing this as the argument. Whether the value can be obtained, and what the value represents, is determined by the field.
Java reference for java.time.OffsetDateTime.get.