Example usage for Java java.time YearMonth fields, constructors, methods, implement or subclass
The text is from its open source code.
Temporal | adjustInto(Temporal temporal) Adjusts the specified temporal object to have this year-month. |
LocalDate | atDay(int dayOfMonth) Combines this year-month with a day-of-month to create a LocalDate . |
LocalDate | atEndOfMonth() Returns a LocalDate at the end of the month. |
int | compareTo(YearMonth other) Compares this year-month to another year-month. |
boolean | equals(Object obj) Checks if this year-month is equal to another year-month. |
String | format(DateTimeFormatter formatter) Formats this year-month using the specified formatter. |
YearMonth | from(TemporalAccessor temporal) Obtains an instance of YearMonth from a temporal object. |
int | get(TemporalField field) Gets the value of the specified field from this year-month as an int . |
long | getLong(TemporalField field) Gets the value of the specified field from this year-month as a long . |
Month | getMonth() Gets the month-of-year field using the Month enum. |
int | getMonthValue() Gets the month-of-year field from 1 to 12. |
int | getYear() Gets the year field. |
int | hashCode() A hash code for this year-month. |
boolean | isAfter(YearMonth other) Checks if this year-month is after the specified year-month. |
boolean | isBefore(YearMonth other) Checks if this year-month is before the specified year-month. |
boolean | isLeapYear() Checks if the year is a leap year, according to the ISO proleptic calendar system rules. |
boolean | isSupported(TemporalField field) Checks if the specified field is supported. |
boolean | isSupported(TemporalUnit unit) Checks if the specified unit is supported. |
boolean | isValidDay(int dayOfMonth) Checks if the day-of-month is valid for this year-month. |
int | lengthOfMonth() Returns the length of the month, taking account of the year. |
int | lengthOfYear() Returns the length of the year. |
YearMonth | minus(long amountToSubtract, TemporalUnit unit) Returns a copy of this year-month with the specified amount subtracted. |
YearMonth | minus(TemporalAmount amountToSubtract) Returns a copy of this year-month with the specified amount subtracted. |
YearMonth | minusMonths(long monthsToSubtract) Returns a copy of this YearMonth with the specified number of months subtracted. |
YearMonth | minusYears(long yearsToSubtract) Returns a copy of this YearMonth with the specified number of years subtracted. |
YearMonth | now() Obtains the current year-month from the system clock in the default time-zone. |
YearMonth | now(ZoneId zone) Obtains the current year-month from the system clock in the specified time-zone. |
YearMonth | now(Clock clock) Obtains the current year-month from the specified clock. |
YearMonth | of(int year, Month month) Obtains an instance of YearMonth from a year and month. |
YearMonth | of(int year, int month) Obtains an instance of YearMonth from a year and month. |
YearMonth | parse(CharSequence text) Obtains an instance of YearMonth from a text string such as 2007-12 . |
YearMonth | parse(CharSequence text, DateTimeFormatter formatter) Obtains an instance of YearMonth from a text string using a specific formatter. |
YearMonth | plus(long amountToAdd, TemporalUnit unit) Returns a copy of this year-month with the specified amount added. |
YearMonth | plus(TemporalAmount amountToAdd) Returns a copy of this year-month with the specified amount added. |
YearMonth | plusMonths(long monthsToAdd) Returns a copy of this YearMonth with the specified number of months added. |
YearMonth | plusYears(long yearsToAdd) Returns a copy of this YearMonth with the specified number of years added. |
R | query(TemporalQuery Queries this year-month using the specified query. |
ValueRange | range(TemporalField field) Gets the range of valid values for the specified field. |
String | toString() Outputs this year-month as a String , such as 2007-12 . |
long | until(Temporal endExclusive, TemporalUnit unit) Calculates the amount of time until another year-month in terms of the specified unit. |
YearMonth | with(TemporalAdjuster adjuster) Returns an adjusted copy of this year-month. |
YearMonth | with(int newYear, int newMonth) Returns a copy of this year-month with the new year and month, checking to see if a new object is in fact required. |
YearMonth | with(TemporalField field, long newValue) Returns a copy of this year-month with the specified field set to a new value. |
YearMonth | withMonth(int month) Returns a copy of this YearMonth with the month-of-year altered. |
YearMonth | withYear(int year) Returns a copy of this YearMonth with the year altered. |