GregorianCalendar Class

Definition

<code>GregorianCalendar</code> is a concrete subclass of <code>Calendar</code> and provides the standard calendar system used by most of the world.

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

Remarks

Java documentation for java.util.GregorianCalendar.

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()

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

GregorianCalendar(Int32, Int32, Int32)

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

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

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

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

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

GregorianCalendar(IntPtr, JniHandleOwnership)

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

GregorianCalendar(Locale)

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

GregorianCalendar(TimeZone)

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

GregorianCalendar(TimeZone, Locale)

Constructs a default <code>GregorianCalendar</code> using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale.

Fields

Ad

Value of the <code>ERA</code> field indicating the common era (Anno Domini), also known as CE.

AllStyles
Obsolete.

A style specifier for #getDisplayNames(int, int, Locale) getDisplayNames indicating names in all styles, such as "January" and "Jan".

(Inherited from Calendar)
Am

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

(Inherited from Calendar)
AmPm
Obsolete.

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

(Inherited from Calendar)
April

Value of the #MONTH field indicating the fourth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
August

Value of the #MONTH field indicating the eighth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
Bc

Value of the <code>ERA</code> field indicating the period before the common era (before Christ), also known as BCE.

Date
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the day of the month.

(Inherited from Calendar)
DayOfMonth
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the day of the month.

(Inherited from Calendar)
DayOfWeek
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the day of the week.

(Inherited from Calendar)
DayOfWeekInMonth
Obsolete.

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

(Inherited from Calendar)
DayOfYear
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the day number within the current year.

(Inherited from Calendar)
December

Value of the #MONTH field indicating the twelfth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
DstOffset
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the daylight saving offset in milliseconds.

(Inherited from Calendar)
Era
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the era, e.

(Inherited from Calendar)
February

Value of the #MONTH field indicating the second month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
FieldCount

The number of distinct fields recognized by <code>get</code> and <code>set</code>.

(Inherited from Calendar)
Friday

Value of the #DAY_OF_WEEK field indicating Friday.

(Inherited from Calendar)
Hour
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the hour of the morning or afternoon.

(Inherited from Calendar)
HourOfDay
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the hour of the day.

(Inherited from Calendar)
January

Value of the #MONTH field indicating the first month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
July

Value of the #MONTH field indicating the seventh month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
June

Value of the #MONTH field indicating the sixth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
Long
Obsolete.

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames equivalent to #LONG_FORMAT.

(Inherited from Calendar)
LongFormat

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a long name used for format.

(Inherited from Calendar)
LongStandalone

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a long name used independently, such as a month name as calendar headers.

(Inherited from Calendar)
March

Value of the #MONTH field indicating the third month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
May

Value of the #MONTH field indicating the fifth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
Millisecond
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the millisecond within the second.

(Inherited from Calendar)
Minute
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the minute within the hour.

(Inherited from Calendar)
Monday

Value of the #DAY_OF_WEEK field indicating Monday.

(Inherited from Calendar)
Month
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the month.

(Inherited from Calendar)
NarrowFormat

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a narrow name used for format.

(Inherited from Calendar)
NarrowStandalone

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a narrow name independently.

(Inherited from Calendar)
November

Value of the #MONTH field indicating the eleventh month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
October

Value of the #MONTH field indicating the tenth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
Pm

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

(Inherited from Calendar)
Saturday

Value of the #DAY_OF_WEEK field indicating Saturday.

(Inherited from Calendar)
Second
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the second within the minute.

(Inherited from Calendar)
September

Value of the #MONTH field indicating the ninth month of the year in the Gregorian and Julian calendars.

(Inherited from Calendar)
Short
Obsolete.

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames equivalent to #SHORT_FORMAT.

(Inherited from Calendar)
ShortFormat

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a short name used for format.

(Inherited from Calendar)
ShortStandalone

A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a short name used independently, such as a month abbreviation as calendar headers.

(Inherited from Calendar)
Sunday

Value of the #DAY_OF_WEEK field indicating Sunday.

(Inherited from Calendar)
Thursday

Value of the #DAY_OF_WEEK field indicating Thursday.

(Inherited from Calendar)
Tuesday

Value of the #DAY_OF_WEEK field indicating Tuesday.

(Inherited from Calendar)
Undecimber

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

(Inherited from Calendar)
Wednesday

Value of the #DAY_OF_WEEK field indicating Wednesday.

(Inherited from Calendar)
WeekOfMonth
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the week number within the current month.

(Inherited from Calendar)
WeekOfYear
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the week number within the current year.

(Inherited from Calendar)
Year
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the year.

(Inherited from Calendar)
ZoneOffset
Obsolete.

Field number for <code>get</code> and <code>set</code> indicating the raw offset from GMT in milliseconds.

(Inherited from Calendar)

Properties

AreFieldsSet

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

(Inherited from Calendar)
CalendarType

Returns the calendar type of this Calendar.

(Inherited from Calendar)
Class

Returns the runtime class of this Object.

(Inherited from Object)
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

Gets what the first day of the week is; e. -or- Sets what the first day of the week is; e.

(Inherited from Calendar)
GregorianChange

Gets the Gregorian Calendar change date. -or- Sets the <code>GregorianCalendar</code> change date.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsTimeSet

Whether time corresponds to the values in fields[].

(Inherited from Calendar)
IsWeekDateSupported

Returns true indicating this GregorianCalendar supports week dates.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
Lenient

Tells whether date/time interpretation is to be lenient. -or- Specifies whether or not date/time interpretation is to be lenient.

(Inherited from Calendar)
MinimalDaysInFirstWeek

Gets what the minimal days required in the first week of the year are; e. -or- Sets what the minimal days required in the first week of the year are; For example, if the first week is defined as one that contains the first day of the first month of a year, call this method with value 1.

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

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

ThresholdType

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

Time

Returns a <code>Date</code> object representing this <code>Calendar</code>'s time value (millisecond offset from the <a href="#Epoch">Epoch</a>"). -or- Sets this Calendar's time with the given <code>Date</code>.

(Inherited from Calendar)
TimeInMillis

Returns this Calendar's time value in milliseconds. -or- Sets this Calendar's current time from the given long value.

(Inherited from Calendar)
TimeZone

Gets the time zone. -or- Sets the time zone with the given time zone value.

(Inherited from Calendar)
WeeksInWeekYear

Returns the number of weeks in the week year represented by this Calendar.

(Inherited from Calendar)
WeekYear

Returns the week year represented by this Calendar.

(Inherited from Calendar)

Methods

Add(CalendarField, Int32)

Adds the specified (signed) amount of time to the given calendar field, based on the calendar's rules.

After(Object)

Returns whether this <code>Calendar</code> represents a time after the time represented by the specified <code>Object</code>.

(Inherited from Calendar)
Before(Object)

Returns whether this <code>Calendar</code> represents a time before the time represented by the specified <code>Object</code>.

(Inherited from Calendar)
Clear()

Sets all the calendar field values and the time value (millisecond offset from the <a href="#Epoch">Epoch</a>) of this <code>Calendar</code> undefined.

(Inherited from Calendar)
Clear(CalendarField)

Sets all the calendar field values and the time value (millisecond offset from the <a href="#Epoch">Epoch</a>) of this <code>Calendar</code> undefined.

(Inherited from Calendar)
Clone()

Creates and returns a copy of this object.

(Inherited from Calendar)
CompareTo(Calendar)

Compares the time values (millisecond offsets from the <a href="#Epoch">Epoch</a>) represented by two <code>Calendar</code> objects.

(Inherited from Calendar)
Complete()

Fills in any unset fields in the calendar fields.

(Inherited from Calendar)
ComputeFields()

Converts the time value (millisecond offset from the <a href="Calendar.

ComputeTime()

Converts calendar field values to the time value (millisecond offset from the <a href="Calendar.

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

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
Get(CalendarField)

Returns the value of the given calendar field.

(Inherited from Calendar)
GetActualMaximum(CalendarField)

Returns the maximum value that the specified calendar field could have, given the time value of this <code>Calendar</code>.

(Inherited from Calendar)
GetActualMinimum(CalendarField)

Returns the minimum value that the specified calendar field could have, given the time value of this <code>Calendar</code>.

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

Returns the string representation of the calendar <code>field</code> value in the given <code>style</code> and <code>locale</code>.

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

Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values.

(Inherited from Calendar)
GetGreatestMinimum(CalendarField)

Returns the highest minimum value for the given calendar field of this <code>GregorianCalendar</code> instance.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetLeastMaximum(CalendarField)

Returns the lowest maximum value for the given calendar field of this <code>GregorianCalendar</code> instance.

GetMaximum(CalendarField)

Returns the maximum value for the given calendar field of this <code>GregorianCalendar</code> instance.

GetMinimum(CalendarField)

Returns the minimum value for the given calendar field of this <code>GregorianCalendar</code> instance.

InternalGet(Int32)

Returns the value of the given calendar field.

(Inherited from Calendar)
IsLeapYear(Int32)

Determines if the given year is a leap year.

IsSet(CalendarField)

Determines if the given calendar field has a value set, including cases that the value has been set by internal fields calculations triggered by a <code>get</code> method call.

(Inherited from Calendar)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Roll(CalendarField, Boolean)

Adds a signed amount to the specified calendar field without changing larger fields.

Roll(CalendarField, Int32)

Adds the specified (signed) amount to the specified calendar field without changing larger fields.

(Inherited from Calendar)
Set(CalendarField, Int32)

Sets the given calendar field to the given value.

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

Sets the given calendar field to the given value.

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

Sets the given calendar field to the given value.

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

Sets the given calendar field to the given value.

(Inherited from Calendar)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetWeekDate(Int32, Int32, Int32)

Sets the date of this Calendar with the the given date specifiers - week year, week of year, and day of week.

(Inherited from Calendar)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

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

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object.

(Inherited from Object)

Explicit Interface Implementations

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

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to