| Package | Description |
|---|---|
| java.time |
The main API for dates, times, instants, and durations.
|
| Modifier and Type | Method and Description |
|---|---|
static Year |
Year.from(TemporalAccessor
Obtains an instance of
Year from a temporal object.
|
Year |
Year.minus(long amountToSubtract, TemporalUnit
Returns a copy of this year with the specified amount subtracted.
|
Year |
Year.minus(TemporalAmount
Returns a copy of this year with the specified amount subtracted.
|
Year |
Year.minusYears(long yearsToSubtract)
Returns a copy of this year with the specified number of years subtracted.
|
static Year |
Year.now()
Obtains the current year from the system clock in the default time-zone.
|
static Year |
Year.now(Clock
Obtains the current year from the specified clock.
|
static Year |
Year.now(ZoneId
Obtains the current year from the system clock in the specified time-zone.
|
static Year |
Year.of(int isoYear)
Obtains an instance of
Year.
|
static Year |
Year.parse(CharSequence
Obtains an instance of
Year from a text string such as
2007.
|
static Year |
Year.parse(CharSequence
Obtains an instance of
Year from a text string using a specific formatter.
|
Year |
Year.plus(long amountToAdd, TemporalUnit
Returns a copy of this year with the specified amount added.
|
Year |
Year.plus(TemporalAmount
Returns a copy of this year with the specified amount added.
|
Year |
Year.plusYears(long yearsToAdd)
Returns a copy of this year with the specified number of years added.
|
Year |
Year.with(TemporalAdjuster
Returns an adjusted copy of this year.
|
Year |
Year.with(TemporalField
Returns a copy of this year with the specified field set to a new value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
Year.compareTo(Year
Compares this year to another year.
|
boolean |
Year.isAfter(Year
Is this year after the specified year.
|
boolean |
Year.isBefore(Year
Is this year before the specified year.
|