官方文档:jse8 https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#getFirstDayOfWeek--
所有方法:
Modifier and Type | Method and Description |
---|---|
abstract 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 |
boolean | before(Object when) Returns whether this |
void | clear() Sets all the calendar field values and the time value (millisecond offset from the Epoch) of this |
void | clear(int field) Sets the given calendar field value and the time value (millisecond offset from the Epoch) of this |
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 |
protected void | complete() Fills in any unset fields in the calendar fields. |
protected abstract void | computeFields() Converts the current millisecond time value |
protected abstract void | computeTime() Converts the current calendar field values in |
boolean | equals(Object obj) Compares this |
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 |
int | getActualMinimum(int field) Returns the minimum value that the specified calendar field could have, given the time value of this |
static Set<String> | getAvailableCalendarTypes() Returns an unmodifiable |
static Locale[] | getAvailableLocales() Returns an array of all locales for which the |
String | getCalendarType() Returns the calendar type of this |
String | getDisplayName(int field, int style, Locale locale) Returns the string representation of the calendar |
Map<String,Integer> | getDisplayNames(int field, int style, Locale locale) Returns a |
int | getFirstDayOfWeek() Gets what the first day of the week is; e.g., |
abstract int | getGreatestMinimum(int field) Returns the highest minimum value for the given calendar field of this |
static Calendar | getInstance() Gets a calendar using the default time zone and locale. |
static Calendar | getInstance(Locale aLocale) Gets a calendar using the default time zone and specified locale. |
static Calendar | getInstance(TimeZone zone) Gets a calendar using the specified time zone and default locale. |
static Calendar | getInstance(TimeZone zone, Locale aLocale) Gets a calendar with the specified time zone and locale. |
abstract int | getLeastMaximum(int field) Returns the lowest maximum value for the given calendar field of this |
abstract int | getMaximum(int field) Returns the maximum value for the given calendar field of this |
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. |
abstract int | getMinimum(int field) Returns the minimum value for the given calendar field of this |
Date | getTime() Returns a |
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 |
int | getWeekYear() Returns the week year represented by this |
int | hashCode() Returns a hash code for this calendar. |
protected int | internalGet(int field) Returns the value of the given calendar field. |
boolean | isLenient() Tells whether date/time interpretation is to be lenient. |
boolean | isSet(int 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 |
boolean | isWeekDateSupported() Returns whether this |
abstract 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 |
void | set(int year, int month, int date, int hourOfDay, int minute) Sets the values for the calendar fields |
void | set(int year, int month, int date, int hourOfDay, int minute, int second) Sets the values for the fields |
void | setFirstDayOfWeek(int value) Sets what the first day of the week is; e.g., |
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 |
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 |
Instant | toInstant() Converts this object to an |
String | toString() Return a string representation of this calendar. |