Example usage for Java java.util GregorianCalendar fields, constructors, methods, implement or subclass
The text is from its open source code.
int | BC Value of the ERA field indicating the period before the common era (before Christ), also known as BCE. |
int | AD Value of the ERA field indicating the common era (Anno Domini), also known as CE. |
GregorianCalendar() Constructs a default GregorianCalendar using the current time in the default time zone with the default Locale.Category#FORMAT FORMAT locale. | |
GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second) Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale. | |
GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute) Constructs a GregorianCalendar with the given date and time set for the default time zone with the default locale. | |
GregorianCalendar(int year, int month, int dayOfMonth) Constructs a GregorianCalendar with the given date set in the default time zone with the default locale. | |
GregorianCalendar(TimeZone zone, Locale locale, boolean flag) Constructs an empty GregorianCalendar. | |
GregorianCalendar(TimeZone zone) Constructs a GregorianCalendar based on the current time in the given time zone with the default Locale.Category#FORMAT FORMAT locale. | |
GregorianCalendar(Locale aLocale) Constructs a GregorianCalendar based on the current time in the default time zone with the given locale. | |
GregorianCalendar(TimeZone zone, Locale aLocale) Constructs a GregorianCalendar based on the current time in the given time zone with the given locale. |
void | add(int field, int amount) Adds the specified (signed) 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() |
int | compareTo(Calendar anotherCalendar) Compares the time values (millisecond offsets from the Epoch) represented by two Calendar objects. |
boolean | equals(Object obj) Compares this GregorianCalendar to the specified Object . |
GregorianCalendar | from(ZonedDateTime zdt) Obtains an instance of GregorianCalendar with the default locale from a ZonedDateTime object. |
int | get(int field) Returns the value of the given calendar field. |
int | getActualMaximum(int field) Returns the maximum value that this calendar field could have, taking into consideration the given time value and the current values of the Calendar#getFirstDayOfWeek() getFirstDayOfWeek , Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek , #getGregorianChange() getGregorianChange and Calendar#getTimeZone() getTimeZone methods. |
int | getActualMinimum(int field) Returns the minimum value that this calendar field could have, taking into consideration the given time value and the current values of the Calendar#getFirstDayOfWeek() getFirstDayOfWeek , Calendar#getMinimalDaysInFirstWeek() getMinimalDaysInFirstWeek , #getGregorianChange() getGregorianChange and Calendar#getTimeZone() getTimeZone methods. |
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 . |
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 GregorianCalendar instance. |
Date | getGregorianChange() Gets the Gregorian Calendar change date. |
Calendar | getInstance() Gets a calendar using the default time zone and locale. |
int | getLeastMaximum(int field) Returns the lowest maximum value for the given calendar field of this GregorianCalendar instance. |
int | getMaximum(int field) Returns the maximum value for the given calendar field of this GregorianCalendar instance. |
int | getMinimum(int field) Returns the minimum value for the given calendar field of this GregorianCalendar 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() |
int | getWeeksInWeekYear() Returns the number of weeks in the week year represented by this GregorianCalendar . |
int | getWeekYear() Returns the week year represented by this GregorianCalendar . |
int | hashCode() Generates the hash code for this GregorianCalendar object. |
boolean | isLeapYear(int year) Determines if the given year is a leap year. |
boolean | isWeekDateSupported() Returns true indicating this GregorianCalendar 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 a signed amount to the specified calendar field without changing larger fields. |
void | set(int year, int month, int date) Sets the values for the calendar fields YEAR , MONTH , and DAY_OF_MONTH . |
void | set(int field, int value) Sets the given calendar field to the given value. |
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 | setGregorianChange(Date date) Sets the GregorianCalendar change date. |
void | setGregorianChange(long cutoverTime) |
void | setLenient(boolean lenient) Specifies whether or not date/time interpretation is to be lenient. |
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 zone) |
void | setWeekDate(int weekYear, int weekOfYear, int dayOfWeek) Sets this GregorianCalendar to the date given by the date specifiers - weekYear , weekOfYear , and dayOfWeek . |
String | toString() Return a string representation of this calendar. |
ZonedDateTime | toZonedDateTime() Converts this object to a ZonedDateTime that represents the same point on the time-line as this GregorianCalendar . |