Example usage for Java java.util Calendar fields, constructors, methods, implement or subclass
The text is from its open source code.
int | ERA Field number for get and set indicating the era, e.g., AD or BC in the Julian calendar. |
int | YEAR Field number for get and set indicating the year. |
int | MONTH Field number for get and set indicating the month. |
int | WEEK_OF_YEAR Field number for get and set indicating the week number within the current year. |
int | WEEK_OF_MONTH Field number for get and set indicating the week number within the current month. |
int | DATE Field number for get and set indicating the day of the month. |
int | DAY_OF_MONTH Field number for get and set indicating the day of the month. |
int | DAY_OF_YEAR Field number for get and set indicating the day number within the current year. |
int | DAY_OF_WEEK Field number for get and set indicating the day of the week. |
int | DAY_OF_WEEK_IN_MONTH Field number for get and set indicating the ordinal number of the day of the week within the current month. |
int | AM_PM Field number for get and set indicating whether the HOUR is before or after noon. |
int | HOUR Field number for get and set indicating the hour of the morning or afternoon. |
int | HOUR_OF_DAY Field number for get and set indicating the hour of the day. |
int | MINUTE Field number for get and set indicating the minute within the hour. |
int | SECOND Field number for get and set indicating the second within the minute. |
int | MILLISECOND Field number for get and set indicating the millisecond within the second. |
int | ZONE_OFFSET Field number for get and set indicating the raw offset from GMT in milliseconds. |
int | DST_OFFSET Field number for get and set indicating the daylight saving offset in milliseconds. |
int | SUNDAY Value of the #DAY_OF_WEEK field indicating Sunday. |
int | MONDAY Value of the #DAY_OF_WEEK field indicating Monday. |
int | TUESDAY Value of the #DAY_OF_WEEK field indicating Tuesday. |
int | WEDNESDAY Value of the #DAY_OF_WEEK field indicating Wednesday. |
int | THURSDAY Value of the #DAY_OF_WEEK field indicating Thursday. |
int | FRIDAY Value of the #DAY_OF_WEEK field indicating Friday. |
int | SATURDAY Value of the #DAY_OF_WEEK field indicating Saturday. |
int | JANUARY Value of the #MONTH field indicating the first month of the year in the Gregorian and Julian calendars. |
int | FEBRUARY Value of the #MONTH field indicating the second month of the year in the Gregorian and Julian calendars. |
int | MARCH Value of the #MONTH field indicating the third month of the year in the Gregorian and Julian calendars. |
int | APRIL Value of the #MONTH field indicating the fourth month of the year in the Gregorian and Julian calendars. |
int | MAY Value of the #MONTH field indicating the fifth month of the year in the Gregorian and Julian calendars. |
int | JUNE Value of the #MONTH field indicating the sixth month of the year in the Gregorian and Julian calendars. |
int | JULY Value of the #MONTH field indicating the seventh month of the year in the Gregorian and Julian calendars. |
int | AUGUST Value of the #MONTH field indicating the eighth month of the year in the Gregorian and Julian calendars. |
int | SEPTEMBER Value of the #MONTH field indicating the ninth month of the year in the Gregorian and Julian calendars. |
int | OCTOBER Value of the #MONTH field indicating the tenth month of the year in the Gregorian and Julian calendars. |
int | NOVEMBER Value of the #MONTH field indicating the eleventh month of the year in the Gregorian and Julian calendars. |
int | DECEMBER Value of the #MONTH field indicating the twelfth month of the year in the Gregorian and Julian calendars. |
int | UNDECIMBER Value of the #MONTH field indicating the thirteenth month of the year. |
int | AM Value of the #AM_PM field indicating the period of the day from midnight to just before noon. |
int | PM Value of the #AM_PM field indicating the period of the day from noon to just before midnight. |
int | ALL_STYLES A style specifier for #getDisplayNames(int,int,Locale) getDisplayNames indicating names in all styles, such as "January" and "Jan". |
int | SHORT A style specifier for #getDisplayName(int,int,Locale) getDisplayName and #getDisplayNames(int,int,Locale) getDisplayNames equivalent to #SHORT_FORMAT . |
int | LONG A style specifier for #getDisplayName(int,int,Locale) getDisplayName and #getDisplayNames(int,int,Locale) getDisplayNames equivalent to #LONG_FORMAT . |
int | SHORT_FORMAT A style specifier for #getDisplayName(int,int,Locale) getDisplayName and #getDisplayNames(int,int,Locale) getDisplayNames indicating a short name used for format. |
boolean | isSet The flags which tell if a specified calendar field for the calendar is set. |
void | add(int field, int amount) Adds or subtracts the specified amount of time to the given calendar field, based on the calendar's rules. |
boolean | after(Object when) Returns whether this Calendar represents a time after the time represented by the specified Object . |
boolean | before(Object when) Returns whether this Calendar represents a time before the time represented by the specified Object . |
void | clear() Sets all the calendar field values and the time value (millisecond offset from the Epoch) of this Calendar undefined. |
void | clear(int field) Sets the given calendar field value and the time value (millisecond offset from the Epoch) of this Calendar undefined. |
Object | clone() Creates and returns a copy of this object. |
int | compareTo(Calendar anotherCalendar) Compares the time values (millisecond offsets from the Epoch) represented by two Calendar objects. |
int | compareTo(long t) |
boolean | equals(Object obj) Compares this Calendar to the specified Object . |
int | get(int field) Returns the value of the given calendar field. |
int | getActualMaximum(int field) Returns the maximum value that the specified calendar field could have, given the time value of this Calendar . |
int | getActualMinimum(int field) Returns the minimum value that the specified calendar field could have, given the time value of this Calendar . |
Class> | getClass() Returns the runtime class of this Object . |
String | getDisplayName(int field, int style, Locale locale) Returns the string representation of the calendar field value in the given style and locale . |
Map | getDisplayNames(int field, int style, Locale locale) Returns a Map containing all names of the calendar field in the given style and locale and their corresponding field values. |
int | getFirstDayOfWeek() Gets what the first day of the week is; e.g., SUNDAY in the U.S., MONDAY in France. |
int | getGreatestMinimum(int field) Returns the highest minimum value for the given calendar field of this Calendar instance. |
Calendar | getInstance() Gets a calendar using the default time zone and locale. |
Calendar | getInstance(TimeZone zone) Gets a calendar using the specified time zone and default locale. |
Calendar | getInstance(Locale aLocale) Gets a calendar using the default time zone and specified locale. |
Calendar | getInstance(TimeZone zone, Locale aLocale) Gets a calendar with the specified time zone and locale. |
int | getLeastMaximum(int field) Returns the lowest maximum value for the given calendar field of this Calendar instance. |
int | getMaximum(int field) Returns the maximum value for the given calendar field of this Calendar instance. |
int | getMinimalDaysInFirstWeek() Gets what the minimal days required in the first week of the year are; e.g., if the first week is defined as one that contains the first day of the first month of a year, this method returns 1. |
int | getMinimum(int field) Returns the minimum value for the given calendar field of this Calendar instance. |
Date | getTime() Returns a Date object representing this Calendar 's time value (millisecond offset from the Epoch"). |
long | getTimeInMillis() Returns this Calendar's time value in milliseconds. |
TimeZone | getTimeZone() Gets the time zone. |
int | getWeeksInWeekYear() Returns the number of weeks in the week year represented by this Calendar . |
int | getWeekYear() Returns the week year represented by this Calendar . |
int | hashCode() Returns a hash code for this calendar. |
boolean | isLenient() Tells whether date/time interpretation is to be lenient. |
boolean | isWeekDateSupported() Returns whether this Calendar supports week dates. |
void | roll(int field, boolean up) Adds or subtracts (up/down) a single unit of time on the given time field without changing larger fields. |
void | roll(int field, int amount) Adds the specified (signed) amount to the specified calendar field without changing larger fields. |
void | set(int field, int value) Sets the given calendar field to the given value. |
void | set(int year, int month, int date) Sets the values for the calendar fields YEAR , MONTH , and DAY_OF_MONTH . |
void | set(int year, int month, int date, int hourOfDay, int minute) Sets the values for the calendar fields YEAR , MONTH , DAY_OF_MONTH , HOUR_OF_DAY , and MINUTE . |
void | set(int year, int month, int date, int hourOfDay, int minute, int second) Sets the values for the fields YEAR , MONTH , DAY_OF_MONTH , HOUR_OF_DAY , MINUTE , and SECOND . |
void | setFirstDayOfWeek(int value) Sets what the first day of the week is; e.g., SUNDAY in the U.S., MONDAY in France. |
void | setLenient(boolean lenient) Specifies whether or not date/time interpretation is to be lenient. |
void | setMinimalDaysInFirstWeek(int value) 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. |
void | setTime(Date date) Sets this Calendar's time with the given Date . |
void | setTimeInMillis(long millis) Sets this Calendar's current time from the given long value. |
void | setTimeZone(TimeZone value) Sets the time zone with the given time zone value. |
void | setWeekDate(int weekYear, int weekOfYear, int dayOfWeek) Sets the date of this Calendar with the given date specifiers - week year, week of year, and day of week. |
Instant | toInstant() Converts this object to an Instant . |
String | toString() Return a string representation of this calendar. |