GregorianCalendar GregorianCalendar Class

Definition

GregorianCalendar is a concrete subclass of Calendar and provides the standard calendar used by most of the world.

[Android.Runtime.Register("java/util/GregorianCalendar", ApiSince=1, DoNotGenerateAcw=true)]
public class GregorianCalendar : Java.Util.Calendar
type GregorianCalendar = class
    inherit Calendar
Inheritance
GregorianCalendarGregorianCalendar
Attributes

Remarks

Android platform documentation

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.

Constructors

GregorianCalendar() GregorianCalendar()

Constructs a new GregorianCalendar initialized to the current date and time with the default Locale and TimeZone.

GregorianCalendar(Int32, Int32, Int32) GregorianCalendar(Int32, Int32, Int32)

Constructs a new GregorianCalendar initialized to midnight in the default TimeZone and Locale on the specified date.

GregorianCalendar(Int32, Int32, Int32, Int32, Int32) GregorianCalendar(Int32, Int32, Int32, Int32, Int32)

Constructs a new GregorianCalendar initialized to the specified date and time in the default TimeZone and Locale.

GregorianCalendar(Int32, Int32, Int32, Int32, Int32, Int32) GregorianCalendar(Int32, Int32, Int32, Int32, Int32, Int32)

Constructs a new GregorianCalendar initialized to the specified date and time in the default TimeZone and Locale.

GregorianCalendar(IntPtr, JniHandleOwnership) GregorianCalendar(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

GregorianCalendar(Locale) GregorianCalendar(Locale)

Constructs a new GregorianCalendar initialized to the current date and time and using the specified Locale and the default TimeZone.

GregorianCalendar(TimeZone) GregorianCalendar(TimeZone)

Constructs a new GregorianCalendar initialized to the current date and time and using the specified TimeZone and the default Locale.

GregorianCalendar(TimeZone, Locale) GregorianCalendar(TimeZone, Locale)

Constructs a new GregorianCalendar initialized to the current date and time and using the specified TimeZone and Locale.

Fields

Ad Ad

Value for the AD era.

AllStyles AllStyles Inherited from Calendar
Am Am

Value of the AM_PM field indicating the period of the day from midnight to just before noon.

(Inherited from Calendar)
AmPm AmPm

Field number for get and set indicating whether the HOUR is before or after noon.

(Inherited from Calendar)
April April

Value of the MONTH field indicating the fourth month of the year.

(Inherited from Calendar)
August August

Value of the MONTH field indicating the eighth month of the year.

(Inherited from Calendar)
Bc Bc

Value for the BC era.

Date Date

Field number for get and set indicating the day of the month.

(Inherited from Calendar)
DayOfMonth DayOfMonth

Field number for get and set indicating the day of the month.

(Inherited from Calendar)
DayOfWeek DayOfWeek

Field number for get and set indicating the day of the week.

(Inherited from Calendar)
DayOfWeekInMonth DayOfWeekInMonth

Field number for get and set indicating the ordinal number of the day of the week within the current month.

(Inherited from Calendar)
DayOfYear DayOfYear

Field number for get and set indicating the day number within the current year.

(Inherited from Calendar)
December December

Value of the MONTH field indicating the twelfth month of the year.

(Inherited from Calendar)
DstOffset DstOffset

Field number for get and set indicating the daylight savings offset from the ZONE_OFFSET in milliseconds.

(Inherited from Calendar)
Era Era

Field number for get and set indicating the era, e.g.

(Inherited from Calendar)
February February

Value of the MONTH field indicating the second month of the year.

(Inherited from Calendar)
FieldCount FieldCount

This is the total number of fields in this calendar.

(Inherited from Calendar)
Friday Friday

Value of the DAY_OF_WEEK field indicating Friday.

(Inherited from Calendar)
Hour Hour

Field number for get and set indicating the hour of the morning or afternoon.

(Inherited from Calendar)
HourOfDay HourOfDay

Field number for get and set indicating the hour of the day.

(Inherited from Calendar)
January January

Value of the MONTH field indicating the first month of the year.

(Inherited from Calendar)
July July

Value of the MONTH field indicating the seventh month of the year.

(Inherited from Calendar)
June June

Value of the MONTH field indicating the sixth month of the year.

(Inherited from Calendar)
Long Long Inherited from Calendar
LongFormat LongFormat Inherited from Calendar
LongStandalone LongStandalone Inherited from Calendar
March March

Value of the MONTH field indicating the third month of the year.

(Inherited from Calendar)
May May

Value of the MONTH field indicating the fifth month of the year.

(Inherited from Calendar)
Millisecond Millisecond

Field number for get and set indicating the millisecond within the second.

(Inherited from Calendar)
Minute Minute

Field number for get and set indicating the minute within the hour.

(Inherited from Calendar)
Monday Monday

Value of the DAY_OF_WEEK field indicating Monday.

(Inherited from Calendar)
Month Month

Field number for get and set indicating the month.

(Inherited from Calendar)
NarrowFormat NarrowFormat Inherited from Calendar
NarrowStandalone NarrowStandalone Inherited from Calendar
November November

Value of the MONTH field indicating the eleventh month of the year.

(Inherited from Calendar)
October October

Value of the MONTH field indicating the tenth month of the year.

(Inherited from Calendar)
Pm Pm

Value of the AM_PM field indicating the period of the day from noon to just before midnight.

(Inherited from Calendar)
Saturday Saturday

Value of the DAY_OF_WEEK field indicating Saturday.

(Inherited from Calendar)
Second Second

Field number for get and set indicating the second within the minute.

(Inherited from Calendar)
September September

Value of the MONTH field indicating the ninth month of the year.

(Inherited from Calendar)
Short Short Inherited from Calendar
ShortFormat ShortFormat Inherited from Calendar
ShortStandalone ShortStandalone Inherited from Calendar
Sunday Sunday

Value of the DAY_OF_WEEK field indicating Sunday.

(Inherited from Calendar)
Thursday Thursday

Value of the DAY_OF_WEEK field indicating Thursday.

(Inherited from Calendar)
Tuesday Tuesday

Value of the DAY_OF_WEEK field indicating Tuesday.

(Inherited from Calendar)
Undecimber Undecimber

Value of the MONTH field indicating the thirteenth month of the year.

(Inherited from Calendar)
Wednesday Wednesday

Value of the DAY_OF_WEEK field indicating Wednesday.

(Inherited from Calendar)
WeekOfMonth WeekOfMonth

Field number for get and set indicating the week number within the current month.

(Inherited from Calendar)
WeekOfYear WeekOfYear

Field number for get and set indicating the week number within the current year.

(Inherited from Calendar)
Year Year

Field number for get and set indicating the year.

(Inherited from Calendar)
ZoneOffset ZoneOffset

Field number for get and set indicating the raw (non-DST) offset from GMT in milliseconds.

(Inherited from Calendar)

Properties

AreFieldsSet AreFieldsSet

True iff the values in fields[] correspond to time.

(Inherited from Calendar)
CalendarType CalendarType Inherited from Calendar
Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
Fields Fields

Contains broken-down field values for the current value of time if areFieldsSet is true, or stale data corresponding to some previous value otherwise.

(Inherited from Calendar)
FirstDayOfWeek FirstDayOfWeek

Returns the first day of the week for this Calendar.

(Inherited from Calendar)
GregorianChange GregorianChange

Returns the gregorian change date of this calendar.

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsTimeSet IsTimeSet

Whether time corresponds to the values in fields[].

(Inherited from Calendar)
IsWeekDateSupported IsWeekDateSupported
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
Lenient Lenient

Tests whether this Calendar accepts field values which are outside the valid range for the field.

(Inherited from Calendar)
MinimalDaysInFirstWeek MinimalDaysInFirstWeek

Returns the minimal days in the first week of the year.

(Inherited from Calendar)
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Time Time

Returns the time of this Calendar as a Date object.

(Inherited from Calendar)
TimeInMillis TimeInMillis

Returns the time represented by this Calendar, recomputing the time from its fields if necessary.

(Inherited from Calendar)
TimeZone TimeZone

Returns the time zone used by this Calendar.

(Inherited from Calendar)
WeeksInWeekYear WeeksInWeekYear Inherited from Calendar
WeekYear WeekYear Inherited from Calendar

Methods

Add(CalendarField, Int32) Add(CalendarField, Int32)

Adds the specified amount to a Calendar field.

After(Object) After(Object)

Returns whether the Date represented by this Calendar instance is after the Date represented by the parameter.

(Inherited from Calendar)
Before(Object) Before(Object)

Returns whether the Date represented by this Calendar instance is before the Date represented by the parameter.

(Inherited from Calendar)
Clear() Clear()

Clears the values of all the time fields, marking them all unset and assigning them all a value of zero.

(Inherited from Calendar)
Clear(CalendarField) Clear(CalendarField)

Clears the value in the given time field, marking it unset and assigning it a value of zero.

(Inherited from Calendar)
Clone() Clone()

Returns a partially deep copy of this Calendar; all fields from from the Calendar class are cloned (deep copy) but fields from subclasses aren't (shallow copy).

(Inherited from Calendar)
CompareTo(Calendar) CompareTo(Calendar)

Compares the time represented by this Calendar to that represented by the given Calendar.

(Inherited from Calendar)
Complete() Complete()

Computes the time from the fields if the time has not already been set.

(Inherited from Calendar)
ComputeFields() ComputeFields()

Computes the Calendar fields from time.

ComputeTime() ComputeTime()

Computes time from the Calendar fields.

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
Get(CalendarField) Get(CalendarField)

Returns the value of the given field after computing the field values by calling complete() first.

(Inherited from Calendar)
GetActualMaximum(CalendarField) GetActualMaximum(CalendarField)

Returns the maximum value of the given field for the current date.

(Inherited from Calendar)
GetActualMinimum(CalendarField) GetActualMinimum(CalendarField)

Returns the minimum value of the given field for the current date.

(Inherited from Calendar)
GetDisplayName(Int32, Int32, Locale) GetDisplayName(Int32, Int32, Locale)

Returns a human-readable string for the value of field using the given style and locale.

(Inherited from Calendar)
GetDisplayNames(Int32, Int32, Locale) GetDisplayNames(Int32, Int32, Locale)

Returns a map of human-readable strings to corresponding values, for the given field, style, and locale.

(Inherited from Calendar)
GetGreatestMinimum(CalendarField) GetGreatestMinimum(CalendarField)

Gets the greatest minimum value of the specified field.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetLeastMaximum(CalendarField) GetLeastMaximum(CalendarField)

Gets the smallest maximum value of the specified field.

GetMaximum(CalendarField) GetMaximum(CalendarField)

Gets the greatest maximum value of the specified field.

GetMinimum(CalendarField) GetMinimum(CalendarField)

Gets the smallest minimum value of the specified field.

InternalGet(Int32) InternalGet(Int32)

Returns the value of the given field without recomputing.

(Inherited from Calendar)
IsLeapYear(Int32) IsLeapYear(Int32)

Returns true if year is a leap year.

IsSet(CalendarField) IsSet(CalendarField)

Tests whether the given field is set.

(Inherited from Calendar)
JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
Roll(CalendarField, Boolean) Roll(CalendarField, Boolean)

Increments or decrements the specified field and wraps the value of the field when it goes beyond the maximum or minimum value for the current date.

Roll(CalendarField, Int32) Roll(CalendarField, Int32)

Adds the given amount to the given field and wraps the value of the field when it goes beyond the maximum or minimum value for the current date.

(Inherited from Calendar)
Set(CalendarField, Int32) Set(CalendarField, Int32)

Sets the given field to the given value.

(Inherited from Calendar)
Set(Int32, Int32, Int32) Set(Int32, Int32, Int32)

Sets the year, month, and day of the month fields.

(Inherited from Calendar)
Set(Int32, Int32, Int32, Int32, Int32) Set(Int32, Int32, Int32, Int32, Int32)

Sets the year, month, day of the month, hour of day, and minute fields.

(Inherited from Calendar)
Set(Int32, Int32, Int32, Int32, Int32, Int32) Set(Int32, Int32, Int32, Int32, Int32, Int32)

Sets the year, month, day of the month, hour of day, minute, and second fields.

(Inherited from Calendar)
SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetWeekDate(Int32, Int32, Int32) SetWeekDate(Int32, Int32, Int32) Inherited from Calendar
ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IComparable.CompareTo(Object) IComparable.CompareTo(Object) Inherited from Calendar
IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to