Share via


Calendar.Get(CalendarField) Method

Definition

Returns the value of the given calendar field.

[Android.Runtime.Register("get", "(I)I", "GetGet_IHandler")]
public virtual int Get (Java.Util.CalendarField field);
[<Android.Runtime.Register("get", "(I)I", "GetGet_IHandler")>]
abstract member Get : Java.Util.CalendarField -> int
override this.Get : Java.Util.CalendarField -> int

Parameters

field
CalendarField

the given calendar field.

Returns

the value for the given calendar field.

Attributes

Exceptions

if the fields are not set, the time is not set, and the time cannot be computed from the current field values.

if the field is not inside the range of possible fields. The range is starting at 0 up to FIELD_COUNT.

Remarks

Returns the value of the given calendar field. In lenient mode, all calendar fields are normalized. In non-lenient mode, all calendar fields are validated and this method throws an exception if any calendar fields have out-of-range values. The normalization and validation are handled by the #complete() method, which process is calendar system dependent.

Java documentation for java.util.Calendar.get(.*int).

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