Calendar Class
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.
The Calendar class is an abstract class that provides methods for converting between a specific instant in time and a set of #fields calendar fields such as YEAR , MONTH , DAY_OF_MONTH , HOUR , and so on, and for manipulating the calendar fields, such as getting the date of the next week.
[Android.Runtime.Register("java/util/Calendar", DoNotGenerateAcw=true)] public abstract class Calendar : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.IO.ISerializable, Java.Lang.ICloneable, Java.Lang.IComparable
[] type Calendar = class inherit Object interface ISerializable interface IJavaObject interface IDisposable interface IJavaPeerable interface ICloneable interface IComparable
Remarks
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
Constructs a Calendar with the default time zone and the default java.util.Locale.Category#FORMAT FORMAT locale.
A constructor used when creating managed representations of JNI objects; called by the runtime.
Constructs a calendar with the specified time zone and locale.
Fields
A style specifier for #getDisplayNames(int, int, Locale) getDisplayNames indicating names in all styles, such as «January» and «Jan».
Value of the #AM_PM field indicating the period of the day from midnight to just before noon.
Field number for get and set indicating whether the HOUR is before or after noon.
Value of the #MONTH field indicating the fourth month of the year in the Gregorian and Julian calendars.
Value of the #MONTH field indicating the eighth month of the year in the Gregorian and Julian calendars.
Field number for get and set indicating the day of the month.
Field number for get and set indicating the day of the month.
Field number for get and set indicating the day of the week.
Field number for get and set indicating the ordinal number of the day of the week within the current month.
Field number for get and set indicating the day number within the current year.
Value of the #MONTH field indicating the twelfth month of the year in the Gregorian and Julian calendars.
Field number for get and set indicating the daylight saving offset in milliseconds.
Field number for get and set indicating the era, e.
Value of the #MONTH field indicating the second month of the year in the Gregorian and Julian calendars.
The number of distinct fields recognized by get and set .
Value of the #DAY_OF_WEEK field indicating Friday.
Field number for get and set indicating the hour of the morning or afternoon.
Field number for get and set indicating the hour of the day.
Value of the #MONTH field indicating the first month of the year in the Gregorian and Julian calendars.
Value of the #MONTH field indicating the seventh month of the year in the Gregorian and Julian calendars.
Value of the #MONTH field indicating the sixth month of the year in the Gregorian and Julian calendars.
A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames equivalent to #LONG_FORMAT .
A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a long name used for format.
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.
Value of the #MONTH field indicating the third month of the year in the Gregorian and Julian calendars.
Value of the #MONTH field indicating the fifth month of the year in the Gregorian and Julian calendars.
Field number for get and set indicating the millisecond within the second.
Field number for get and set indicating the minute within the hour.
Value of the #DAY_OF_WEEK field indicating Monday.
Field number for get and set indicating the month.
A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a narrow name used for format.
A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a narrow name independently.
Value of the #MONTH field indicating the eleventh month of the year in the Gregorian and Julian calendars.
Value of the #MONTH field indicating the tenth month of the year in the Gregorian and Julian calendars.
Value of the #AM_PM field indicating the period of the day from noon to just before midnight.
Value of the #DAY_OF_WEEK field indicating Saturday.
Field number for get and set indicating the second within the minute.
Value of the #MONTH field indicating the ninth month of the year in the Gregorian and Julian calendars.
A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames equivalent to #SHORT_FORMAT .
A style specifier for #getDisplayName(int, int, Locale) getDisplayName and #getDisplayNames(int, int, Locale) getDisplayNames indicating a short name used for format.
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.
Value of the #DAY_OF_WEEK field indicating Sunday.
Value of the #DAY_OF_WEEK field indicating Thursday.
Value of the #DAY_OF_WEEK field indicating Tuesday.
Value of the #MONTH field indicating the thirteenth month of the year.
Value of the #DAY_OF_WEEK field indicating Wednesday.
Field number for get and set indicating the week number within the current month.
Field number for get and set indicating the week number within the current year.
Field number for get and set indicating the year.
Field number for get and set indicating the raw offset from GMT in milliseconds.
Properties
True if fields[] are in sync with the currently set time.
Returns an unmodifiable Set containing all calendar types supported by Calendar in the runtime environment.
Returns the calendar type of this Calendar .
Returns the runtime class of this Object .
The calendar field values for the currently set time for this calendar.
Gets what the first day of the week is; e. -or- Sets what the first day of the week is; e.
The handle to the underlying Android instance.
Gets a calendar using the default time zone and locale.
True if then the value of time is valid.
Returns whether this Calendar supports week dates.
Tells whether date/time interpretation is to be lenient. -or- Specifies whether or not date/time interpretation is to be lenient.
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.
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
Returns a Date object representing this Calendar ‘s time value (millisecond offset from the «#Epoch»>Epoch»). -or- Sets this Calendar’s time with the given Date .
Returns this Calendar’s time value in milliseconds. -or- Sets this Calendar’s current time from the given long value.
Gets the time zone. -or- Sets the time zone with the given time zone value.
Returns the number of weeks in the week year represented by this Calendar .
Returns the week year represented by this Calendar .
Methods
Adds or subtracts the specified amount of time to the given calendar field, based on the calendar’s rules.
Returns whether this Calendar represents a time after the time represented by the specified Object .
Returns whether this Calendar represents a time before the time represented by the specified Object .
Sets all the calendar field values and the time value (millisecond offset from the «#Epoch»>Epoch) of this Calendar undefined.
Sets the given calendar field value and the time value (millisecond offset from the «#Epoch»>Epoch) of this Calendar undefined.
Creates and returns a copy of this object.
Compares the time values (millisecond offsets from the «#Epoch»>Epoch) represented by two Calendar objects.
Fills in any unset fields in the calendar fields.
Converts the current millisecond time value #time to calendar field values in #fields fields[] .
Converts the current calendar field values in #fields fields[] to the millisecond time value #time .
Indicates whether some other object is «equal to» this one.
Returns the value of the given calendar field.
Returns the maximum value that the specified calendar field could have, given the time value of this Calendar .
Returns the minimum value that the specified calendar field could have, given the time value of this Calendar .
Returns an array of all locales for which the getInstance methods of this class can return localized instances.
Returns the string representation of the calendar field value in the given style and locale .
Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values.
Returns the highest minimum value for the given calendar field of this Calendar instance.
Returns a hash code value for the object.
Gets a calendar using the default time zone and specified locale.
Gets a calendar using the specified time zone and default locale.
Gets a calendar with the specified time zone and locale.
Returns the lowest maximum value for the given calendar field of this Calendar instance.
Returns the maximum value for the given calendar field of this Calendar instance.
Returns the minimum value for the given calendar field of this Calendar instance.
Returns the value of the given calendar field.
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 get method call.
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
Wakes up a single thread that is waiting on this object’s monitor.
Wakes up all threads that are waiting on this object’s monitor.
Adds or subtracts (up/down) a single unit of time on the given time field without changing larger fields.
Adds the specified (signed) amount to the specified calendar field without changing larger fields.
Sets the given calendar field to the given value.
Sets the values for the calendar fields YEAR , MONTH , and DAY_OF_MONTH .
Sets the values for the calendar fields YEAR , MONTH , DAY_OF_MONTH , HOUR_OF_DAY , and MINUTE .
Sets the values for the fields YEAR , MONTH , DAY_OF_MONTH , HOUR_OF_DAY , MINUTE , and SECOND .
Sets the date of this Calendar with the the given date specifiers — week year, week of year, and day of week.
Returns a string representation of the object.
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.
Causes the current thread to wait until either another thread invokes the java.lang.Object#notify() method or the java.lang.Object#notifyAll() method for this object, or a specified amount of time has elapsed.
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, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
Explicit Interface Implementations
IComparable.CompareTo(Object) | |
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
Performs an Android runtime-checked type conversion.