Package java.util
Class GregorianCalendar
java.lang.Object
java.util.Calendar
java.util.GregorianCalendar
- All Implemented Interfaces:
Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intValue of theERAfield indicating the common era (Anno Domini), also known as CE.static final intValue of theERAfield indicating the period before the common era (before Christ), also known as BCE.protected static final longFields inherited from class java.util.Calendar
AM, AM_PM, APRIL, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, ERA, FEBRUARY, FRIDAY, HOUR, HOUR_OF_DAY, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int field, int value) voidclear()clone()voidvoidintget(int field) getTime()longReturns this Calendar's time value in milliseconds.voidset(int field, int value) Sets the given calendar field to the given value.voidSets this Calendar's time with the givenDate.voidsetTimeInMillis(long millis) Sets this Calendar's current time from the given long value.Methods inherited from class java.util.Calendar
after, before, compareTo, equals, getActualMaximum, getActualMinimum, getFirstDayOfWeek, getInstance, getMinimalDaysInFirstWeek, isLenient, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek
-
Field Details
-
BC
public static final int BCValue of theERAfield indicating the period before the common era (before Christ), also known as BCE. The sequence of years at the transition fromBCtoADis ..., 2 BC, 1 BC, 1 AD, 2 AD,...- See Also:
-
AD
public static final int ADValue of theERAfield indicating the common era (Anno Domini), also known as CE. The sequence of years at the transition fromBCtoADis ..., 2 BC, 1 BC, 1 AD, 2 AD,...- See Also:
-
ONE_DAY
protected static final long ONE_DAY- See Also:
-
-
Constructor Details
-
GregorianCalendar
public GregorianCalendar()
-
-
Method Details
-
clone
-
clear
public void clear() -
computeFields
public void computeFields() -
computeTime
public void computeTime() -
getTime
Description copied from class:Calendar -
setTime
Description copied from class:CalendarSets this Calendar's time with the givenDate.Note: Calling
setTime()withDate(Long.MAX_VALUE)orDate(Long.MIN_VALUE)may yield incorrect field values fromget(). -
setTimeInMillis
public void setTimeInMillis(long millis) Description copied from class:CalendarSets this Calendar's current time from the given long value.- Specified by:
setTimeInMillisin classCalendar- Parameters:
millis- the new time in UTC milliseconds from the epoch.- See Also:
-
getTimeInMillis
public long getTimeInMillis()Description copied from class:CalendarReturns this Calendar's time value in milliseconds.- Specified by:
getTimeInMillisin classCalendar- Returns:
- the current time as UTC milliseconds from the epoch.
- See Also:
-
get
public int get(int field) -
set
public void set(int field, int value) Description copied from class:CalendarSets the given calendar field to the given value. The value is not interpreted by this method regardless of the leniency mode. -
add
public void add(int field, int value)
-