Java java.time YearMonth fields, constructors, methods, implement or subclass

Example usage for Java java.time YearMonth fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.time YearMonth.

The text is from its open source code.

Method

TemporaladjustInto(Temporal temporal)
Adjusts the specified temporal object to have this year-month.
LocalDateatDay(int dayOfMonth)
Combines this year-month with a day-of-month to create a LocalDate .
LocalDateatEndOfMonth()
Returns a LocalDate at the end of the month.
intcompareTo(YearMonth other)
Compares this year-month to another year-month.
booleanequals(Object obj)
Checks if this year-month is equal to another year-month.
Stringformat(DateTimeFormatter formatter)
Formats this year-month using the specified formatter.
YearMonthfrom(TemporalAccessor temporal)
Obtains an instance of YearMonth from a temporal object.
intget(TemporalField field)
Gets the value of the specified field from this year-month as an int .
longgetLong(TemporalField field)
Gets the value of the specified field from this year-month as a long .
MonthgetMonth()
Gets the month-of-year field using the Month enum.
intgetMonthValue()
Gets the month-of-year field from 1 to 12.
intgetYear()
Gets the year field.
inthashCode()
A hash code for this year-month.
booleanisAfter(YearMonth other)
Checks if this year-month is after the specified year-month.
booleanisBefore(YearMonth other)
Checks if this year-month is before the specified year-month.
booleanisLeapYear()
Checks if the year is a leap year, according to the ISO proleptic calendar system rules.
booleanisSupported(TemporalField field)
Checks if the specified field is supported.
booleanisSupported(TemporalUnit unit)
Checks if the specified unit is supported.
booleanisValidDay(int dayOfMonth)
Checks if the day-of-month is valid for this year-month.
intlengthOfMonth()
Returns the length of the month, taking account of the year.
intlengthOfYear()
Returns the length of the year.
YearMonthminus(long amountToSubtract, TemporalUnit unit)
Returns a copy of this year-month with the specified amount subtracted.
YearMonthminus(TemporalAmount amountToSubtract)
Returns a copy of this year-month with the specified amount subtracted.
YearMonthminusMonths(long monthsToSubtract)
Returns a copy of this YearMonth with the specified number of months subtracted.
YearMonthminusYears(long yearsToSubtract)
Returns a copy of this YearMonth with the specified number of years subtracted.
YearMonthnow()
Obtains the current year-month from the system clock in the default time-zone.
YearMonthnow(ZoneId zone)
Obtains the current year-month from the system clock in the specified time-zone.
YearMonthnow(Clock clock)
Obtains the current year-month from the specified clock.
YearMonthof(int year, Month month)
Obtains an instance of YearMonth from a year and month.
YearMonthof(int year, int month)
Obtains an instance of YearMonth from a year and month.
YearMonthparse(CharSequence text)
Obtains an instance of YearMonth from a text string such as 2007-12 .
YearMonthparse(CharSequence text, DateTimeFormatter formatter)
Obtains an instance of YearMonth from a text string using a specific formatter.
YearMonthplus(long amountToAdd, TemporalUnit unit)
Returns a copy of this year-month with the specified amount added.
YearMonthplus(TemporalAmount amountToAdd)
Returns a copy of this year-month with the specified amount added.
YearMonthplusMonths(long monthsToAdd)
Returns a copy of this YearMonth with the specified number of months added.
YearMonthplusYears(long yearsToAdd)
Returns a copy of this YearMonth with the specified number of years added.
Rquery(TemporalQuery query)
Queries this year-month using the specified query.
ValueRangerange(TemporalField field)
Gets the range of valid values for the specified field.
StringtoString()
Outputs this year-month as a String , such as 2007-12 .
longuntil(Temporal endExclusive, TemporalUnit unit)
Calculates the amount of time until another year-month in terms of the specified unit.
YearMonthwith(TemporalAdjuster adjuster)
Returns an adjusted copy of this year-month.
YearMonthwith(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.
YearMonthwith(TemporalField field, long newValue)
Returns a copy of this year-month with the specified field set to a new value.
YearMonthwithMonth(int month)
Returns a copy of this YearMonth with the month-of-year altered.
YearMonthwithYear(int year)
Returns a copy of this YearMonth with the year altered.