Uses of Class
java.time.YearMonth
Packages that use YearMonth
-
Uses of YearMonth in java.time
Modifier and TypeMethodDescriptionYear.atMonth(int month)Combines this year with a month to create aYearMonth.Combines this year with a month to create aYearMonth.static YearMonthYearMonth.from(TemporalAccessor temporal)Obtains an instance ofYearMonthfrom a temporal object.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 thisYearMonthwith the specified number of months subtracted.YearMonth.minusYears(long yearsToSubtract)Returns a copy of thisYearMonthwith the specified number of years subtracted.static YearMonthYearMonth.now()Obtains the current year-month from the system clock in the default time-zone.static YearMonthObtains the current year-month from the specified clock.static YearMonthObtains the current year-month from the system clock in the specified time-zone.static YearMonthYearMonth.of(int year, int month)Obtains an instance ofYearMonthfrom a year and month.static YearMonthObtains an instance ofYearMonthfrom a year and month.static YearMonthYearMonth.parse(CharSequence text)Obtains an instance ofYearMonthfrom a text string such as2007-12.static YearMonthYearMonth.parse(CharSequence text, DateTimeFormatter formatter)Obtains an instance ofYearMonthfrom 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 thisYearMonthwith the specified number of months added.YearMonth.plusYears(long yearsToAdd)Returns a copy of thisYearMonthwith the specified number of years added.YearMonth.with(TemporalAdjuster adjuster)Returns an adjusted copy of this year-month.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 thisYearMonthwith the month-of-year altered.YearMonth.withYear(int year)Returns a copy of thisYearMonthwith the year altered.Modifier and TypeMethodDescriptionintCompares this year-month to another year-month.booleanChecks if this year-month is after the specified year-month.booleanChecks if this year-month is before the specified year-month.