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.temporal |
Access to date and time using fields and units, and date time adjusters.
|
Modifier and Type | Class and Description |
---|---|
class |
Duration
A time-based amount of time, such as '34.5 seconds'.
|
class |
Period
A date-based amount of time in the ISO-8601 calendar system,
such as '2 years, 3 months and 4 days'.
|
Modifier and Type | Method and Description |
---|---|
static Period |
Period.from(TemporalAmount amount)
Obtains an instance of
Period from a temporal amount. |
static Duration |
Duration.from(TemporalAmount amount)
Obtains an instance of
Duration from a temporal amount. |
Year |
Year.minus(TemporalAmount amountToSubtract)
Returns a copy of this year with the specified amount subtracted.
|
YearMonth |
YearMonth.minus(TemporalAmount amountToSubtract)
Returns a copy of this year-month with the specified amount subtracted.
|
Period |
Period.minus(TemporalAmount amountToSubtract)
Returns a copy of this period with the specified period subtracted.
|
OffsetTime |
OffsetTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this time with the specified amount subtracted.
|
LocalDateTime |
LocalDateTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this date-time with the specified amount subtracted.
|
LocalDate |
LocalDate.minus(TemporalAmount amountToSubtract)
Returns a copy of this date with the specified amount subtracted.
|
ZonedDateTime |
ZonedDateTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this date-time with the specified amount subtracted.
|
OffsetDateTime |
OffsetDateTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this date-time with the specified amount subtracted.
|
Instant |
Instant.minus(TemporalAmount amountToSubtract)
Returns a copy of this instant with the specified amount subtracted.
|
LocalTime |
LocalTime.minus(TemporalAmount amountToSubtract)
Returns a copy of this time with the specified amount subtracted.
|
Year |
Year.plus(TemporalAmount amountToAdd)
Returns a copy of this year with the specified amount added.
|
YearMonth |
YearMonth.plus(TemporalAmount amountToAdd)
Returns a copy of this year-month with the specified amount added.
|
Period |
Period.plus(TemporalAmount amountToAdd)
Returns a copy of this period with the specified period added.
|
OffsetTime |
OffsetTime.plus(TemporalAmount amountToAdd)
Returns a copy of this time with the specified amount added.
|
LocalDateTime |
LocalDateTime.plus(TemporalAmount amountToAdd)
Returns a copy of this date-time with the specified amount added.
|
LocalDate |
LocalDate.plus(TemporalAmount amountToAdd)
Returns a copy of this date with the specified amount added.
|
ZonedDateTime |
ZonedDateTime.plus(TemporalAmount amountToAdd)
Returns a copy of this date-time with the specified amount added.
|
OffsetDateTime |
OffsetDateTime.plus(TemporalAmount amountToAdd)
Returns a copy of this date-time with the specified amount added.
|
Instant |
Instant.plus(TemporalAmount amountToAdd)
Returns a copy of this instant with the specified amount added.
|
LocalTime |
LocalTime.plus(TemporalAmount amountToAdd)
Returns a copy of this time with the specified amount added.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ChronoPeriod
A date-based amount of time, such as '3 years, 4 months and 5 days' in an
arbitrary chronology, intended for advanced globalization use cases.
|
Modifier and Type | Method and Description |
---|---|
ThaiBuddhistDate |
ThaiBuddhistDate.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
JapaneseDate |
JapaneseDate.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
HijrahDate |
HijrahDate.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
MinguoDate |
MinguoDate.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
ChronoPeriod |
ChronoPeriod.minus(TemporalAmount amountToSubtract)
Returns a copy of this period with the specified period subtracted.
|
default ChronoLocalDateTime<D> |
ChronoLocalDateTime.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
default ChronoLocalDate |
ChronoLocalDate.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
default ChronoZonedDateTime<D> |
ChronoZonedDateTime.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
ThaiBuddhistDate |
ThaiBuddhistDate.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
JapaneseDate |
JapaneseDate.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
HijrahDate |
HijrahDate.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
MinguoDate |
MinguoDate.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
ChronoPeriod |
ChronoPeriod.plus(TemporalAmount amountToAdd)
Returns a copy of this period with the specified period added.
|
default ChronoLocalDateTime<D> |
ChronoLocalDateTime.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
default ChronoLocalDate |
ChronoLocalDate.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
default ChronoZonedDateTime<D> |
ChronoZonedDateTime.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
Modifier and Type | Method and Description |
---|---|
default Temporal |
Temporal.minus(TemporalAmount amount)
Returns an object of the same type as this object with an amount subtracted.
|
default Temporal |
Temporal.plus(TemporalAmount amount)
Returns an object of the same type as this object with an amount added.
|
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, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.