Package | Description |
---|---|
java.time |
The main API for dates, times, instants, and durations.
|
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(TemporalAccessor start,
TemporalAccessor end)
Returns a
Period consisting of the number of years, months, days,
hours, minutes, seconds, and nanoseconds between two TemporalAccessor instances. |
static Period |
Period.betweenISO(LocalDate startDate,
LocalDate endDate)
Obtains a
Period consisting of the number of years, months,
and days between two dates. |
static Period |
Period.betweenISO(LocalTime startTime,
LocalTime endTime)
Obtains a
Period consisting of the number of hours, minutes,
seconds and nanoseconds between two times. |
Period |
Period.minus(long amount,
TemporalUnit unit)
Returns a copy of this period with the specified period subtracted.
|
Period |
Period.minus(Period other)
Returns a copy of this period with the specified period subtracted.
|
Period |
Period.minusDays(long amount) |
Period |
Period.minusHours(long amount) |
Period |
Period.minusMinutes(long amount) |
Period |
Period.minusMonths(long amount) |
Period |
Period.minusNanos(long amount) |
Period |
Period.minusSeconds(long amount) |
Period |
Period.minusYears(long amount) |
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.normalizedDaysToHours()
Returns a copy of this period with any days converted to hours using a 24 hour day.
|
Period |
Period.normalizedHoursToDays()
Returns a copy of this period with the days and hours normalized using a 24 hour day.
|
Period |
Period.normalizedMonthsISO()
Returns a copy of this period with the years and months normalized using a 12 month year.
|
static Period |
Period.of(Duration duration)
Obtains a
Period from a Duration . |
static Period |
Period.of(int years,
int months,
int days,
int hours,
int minutes,
int seconds)
Obtains a
Period from date-based and time-based fields. |
static Period |
Period.of(int years,
int months,
int days,
int hours,
int minutes,
int seconds,
long nanos)
Obtains a
Period from date-based and time-based fields. |
static Period |
Period.of(long amount,
TemporalUnit unit)
Obtains an instance of
Period from a period in the specified unit. |
static Period |
Period.ofDate(int years,
int months,
int days)
Obtains a
Period from date-based fields. |
static Period |
Period.ofTime(int hours,
int minutes,
int seconds)
Obtains a
Period from time-based fields. |
static Period |
Period.ofTime(int hours,
int minutes,
int seconds,
long nanos)
Obtains a
Period from time-based fields. |
static Period |
Period.parse(java.lang.CharSequence text)
Obtains a
Period from a text string such as PnYnMnDTnHnMn.nS . |
Period |
Period.plus(long amount,
TemporalUnit unit)
Returns a copy of this period with the specified period added.
|
Period |
Period.plus(Period other)
Returns a copy of this period with the specified period added.
|
Period |
Period.plusDays(long amount) |
Period |
Period.plusHours(long amount) |
Period |
Period.plusMinutes(long amount) |
Period |
Period.plusMonths(long amount) |
Period |
Period.plusNanos(long amount) |
Period |
Period.plusSeconds(long amount) |
Period |
Period.plusYears(long amount) |
Period |
Period.toDateOnly()
Converts this period to one that only has date units.
|
Period |
Period.toTimeOnly()
Converts this period to one that only has time units.
|
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.withTimeNanos(long nanos)
Returns a copy of this period with the specified total amount of time units
expressed in nanoseconds.
|
Period |
Period.withYears(int years)
Returns a copy of this period with the specified amount of years.
|
Modifier and Type | Method and Description |
---|---|
Period |
Period.minus(Period other)
Returns a copy of this period with the specified period subtracted.
|
Period |
Period.plus(Period other)
Returns a copy of this period with the specified period added.
|