Package | Description |
---|---|
java.time |
The main API for dates, times, instants, and durations.
|
java.time.chrono |
Generic API for calendar systems other than the default ISO.
|
java.time.format |
Provides classes to print and parse dates and times.
|
Modifier and Type | Field and Description |
---|---|
static Period |
Period.ZERO
A constant for a period of zero.
|
Modifier and Type | Method and Description |
---|---|
static Period |
Period.between(LocalDate startDateInclusive,
LocalDate endDateExclusive)
Obtains a
Period consisting of the number of years, months,
and days between two dates. |
static Period |
Period.from(TemporalAmount amount)
Obtains an instance of
Period from a temporal amount. |
Period |
Period.minus(TemporalAmount amountToSubtract)
Returns a copy of this period with the specified period subtracted.
|
Period |
Period.minusDays(long daysToSubtract)
Returns a copy of this period with the specified days subtracted.
|
Period |
Period.minusMonths(long monthsToSubtract)
Returns a copy of this period with the specified months subtracted.
|
Period |
Period.minusYears(long yearsToSubtract)
Returns a copy of this period with the specified years subtracted.
|
Period |
Period.multipliedBy(int scalar)
Returns a new instance with each element in this period multiplied
by the specified scalar.
|
Period |
Period.negated()
Returns a new instance with each amount in this period negated.
|
Period |
Period.normalized()
Returns a copy of this period with the years and months normalized.
|
static Period |
Period.of(int years,
int months,
int days)
Obtains a
Period representing a number of years, months and days. |
static Period |
Period.ofDays(int days)
Obtains a
Period representing a number of days. |
static Period |
Period.ofMonths(int months)
Obtains a
Period representing a number of months. |
static Period |
Period.ofWeeks(int weeks)
Obtains a
Period representing a number of weeks. |
static Period |
Period.ofYears(int years)
Obtains a
Period representing a number of years. |
static Period |
Period.parse(CharSequence text)
Obtains a
Period from a text string such as PnYnMnD . |
Period |
Period.plus(TemporalAmount amountToAdd)
Returns a copy of this period with the specified period added.
|
Period |
Period.plusDays(long daysToAdd)
Returns a copy of this period with the specified days added.
|
Period |
Period.plusMonths(long monthsToAdd)
Returns a copy of this period with the specified months added.
|
Period |
Period.plusYears(long yearsToAdd)
Returns a copy of this period with the specified years added.
|
Period |
LocalDate.until(ChronoLocalDate endDateExclusive)
Calculates the period between this date and another date as a
Period . |
Period |
Period.withDays(int days)
Returns a copy of this period with the specified amount of days.
|
Period |
Period.withMonths(int months)
Returns a copy of this period with the specified amount of months.
|
Period |
Period.withYears(int years)
Returns a copy of this period with the specified amount of years.
|
Modifier and Type | Method and Description |
---|---|
Period |
IsoChronology.period(int years,
int months,
int days)
Obtains a period for this chronology based on years, months and days.
|
Modifier and Type | Method and Description |
---|---|
static TemporalQuery<Period> |
DateTimeFormatter.parsedExcessDays()
A query that provides access to the excess days that were parsed.
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2018, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.