Package | Description |
---|---|
java.time |
The main API for dates, times, instants, and durations.
|
java.time.temporal |
Access to date and time using fields and units, additional value type classes and
base support for calendar systems other than the default ISO.
|
Modifier and Type | Class and Description |
---|---|
class |
Instant
An instantaneous point on the time-line.
|
class |
LocalDate
A date without a time-zone in the ISO-8601 calendar system,
such as
2007-12-03 . |
class |
LocalDateTime
A date-time without a time-zone in the ISO-8601 calendar system,
such as
2007-12-03T10:15:30 . |
class |
LocalTime
A time without time-zone in the ISO-8601 calendar system,
such as
10:15:30 . |
class |
ZonedDateTime
A date-time with a time-zone in the ISO-8601 calendar system,
such as
2007-12-03T10:15:30+01:00 Europe/Paris . |
Modifier and Type | Method and Description |
---|---|
Temporal |
Duration.addTo(Temporal temporal)
Adds this duration to the specified temporal object.
|
Temporal |
Period.addTo(Temporal temporal)
Adds this period to the specified temporal object.
|
Temporal |
Instant.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this instant.
|
Temporal |
LocalTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same time as this object.
|
Temporal |
Month.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this month-of-year.
|
Temporal |
ZoneOffset.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset as this object.
|
Temporal |
DayOfWeek.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this day-of-week.
|
Temporal |
LocalDateTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date and time as this object.
|
Temporal |
LocalDate.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date as this object.
|
Temporal |
Duration.subtractFrom(Temporal temporal)
Subtracts this duration from the specified temporal object.
|
Temporal |
Period.subtractFrom(Temporal temporal)
Subtracts this period from the specified temporal object.
|
Modifier and Type | Method and Description |
---|---|
Temporal |
Duration.addTo(Temporal temporal)
Adds this duration to the specified temporal object.
|
Temporal |
Period.addTo(Temporal temporal)
Adds this period to the specified temporal object.
|
Temporal |
Instant.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this instant.
|
Temporal |
LocalTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same time as this object.
|
Temporal |
Month.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this month-of-year.
|
Temporal |
ZoneOffset.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset as this object.
|
Temporal |
DayOfWeek.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this day-of-week.
|
Temporal |
LocalDateTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date and time as this object.
|
Temporal |
LocalDate.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date as this object.
|
long |
Instant.periodUntil(Temporal endInstant,
TemporalUnit unit)
Calculates the period between this instant and another instant in
terms of the specified unit.
|
long |
LocalTime.periodUntil(Temporal endTime,
TemporalUnit unit)
Calculates the period between this time and another time in
terms of the specified unit.
|
long |
LocalDateTime.periodUntil(Temporal endDateTime,
TemporalUnit unit)
Calculates the period between this date-time and another date-time in
terms of the specified unit.
|
long |
LocalDate.periodUntil(Temporal endDate,
TemporalUnit unit)
Calculates the period between this date and another date in
terms of the specified unit.
|
long |
ZonedDateTime.periodUntil(Temporal endDateTime,
TemporalUnit unit)
Calculates the period between this date-time and another date-time in
terms of the specified unit.
|
Temporal |
Duration.subtractFrom(Temporal temporal)
Subtracts this duration from the specified temporal object.
|
Temporal |
Period.subtractFrom(Temporal temporal)
Subtracts this period from the specified temporal object.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ChronoLocalDate<C extends Chrono<C>>
A date without time-of-day or time-zone in an arbitrary chronology, intended
for advanced globalization use cases.
|
interface |
ChronoLocalDateTime<C extends Chrono<C>>
A date-time without a time-zone in an arbitrary chronology, intended
for advanced globalization use cases.
|
interface |
ChronoZonedDateTime<C extends Chrono<C>>
A date-time with a time-zone in an arbitrary chronology,
intended for advanced globalization use cases.
|
Modifier and Type | Class and Description |
---|---|
class |
OffsetDate
A date with an offset from UTC/Greenwich in the ISO-8601 calendar system,
such as
2007-12-03+01:00 . |
class |
OffsetDateTime
A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
such as
2007-12-03T10:15:30+01:00 . |
class |
OffsetTime
A time with an offset from UTC/Greenwich in the ISO-8601 calendar system,
such as
10:15:30+01:00 . |
class |
Year
A year in the ISO-8601 calendar system, such as
2007 . |
class |
YearMonth
A year-month in the ISO-8601 calendar system, such as
2007-12 . |
Modifier and Type | Method and Description |
---|---|
<R extends Temporal> |
ChronoUnit.between(R dateTime1,
R dateTime2) |
<R extends Temporal> |
TemporalUnit.between(R dateTime1,
R dateTime2)
Calculates the period in terms of this unit between two temporal objects of the same type.
|
<R extends Temporal> |
ChronoUnit.doPlus(R dateTime,
long periodToAdd) |
<R extends Temporal> |
TemporalUnit.doPlus(R dateTime,
long periodToAdd)
Returns a copy of the specified temporal object with the specified period added.
|
<R extends Temporal> |
TemporalField.doWith(R temporal,
long newValue)
Returns a copy of the specified temporal object with the value of this field set.
|
<R extends Temporal> |
ChronoField.doWith(R temporal,
long newValue) |
Modifier and Type | Method and Description |
---|---|
Temporal |
SimplePeriod.addTo(Temporal temporal)
Adds this period to the specified temporal object.
|
Temporal |
TemporalAdder.addTo(Temporal temporal)
Adds to the specified temporal object.
|
default Temporal |
ChronoLocalDate.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date as this object.
|
Temporal |
MonthDay.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this month-day.
|
Temporal |
OffsetDate.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset and date
as this object.
|
Temporal |
YearMonth.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this year-month.
|
Temporal |
OffsetDateTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset, date
and time as this object.
|
default Temporal |
ChronoLocalDateTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date and time as this object.
|
Temporal |
TemporalAdjuster.adjustInto(Temporal temporal)
Adjusts the specified temporal object.
|
Temporal |
OffsetTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset and time
as this object.
|
default Temporal |
Era.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same era as this object.
|
Temporal |
Year.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this year.
|
default Temporal |
Temporal.minus(long amountToSubtract,
TemporalUnit unit)
Returns an object of the same type as this object with the specified period subtracted.
|
default Temporal |
Temporal.minus(TemporalSubtractor subtractor)
Returns an object of the same type as this object with an amount subtracted.
|
Temporal |
Temporal.plus(long amountToAdd,
TemporalUnit unit)
Returns an object of the same type as this object with the specified period added.
|
default Temporal |
Temporal.plus(TemporalAdder adder)
Returns an object of the same type as this object with an amount added.
|
Temporal |
TemporalSubtractor.subtractFrom(Temporal temporal)
Subtracts this object from the specified temporal object.
|
Temporal |
SimplePeriod.subtractFrom(Temporal temporal)
Subtracts this period to the specified temporal object.
|
default Temporal |
Temporal.with(TemporalAdjuster adjuster)
Returns an adjusted object of the same type as this object with the adjustment made.
|
Temporal |
Temporal.with(TemporalField field,
long newValue)
Returns an object of the same type as this object with the specified field altered.
|
Modifier and Type | Method and Description |
---|---|
Temporal |
SimplePeriod.addTo(Temporal temporal)
Adds this period to the specified temporal object.
|
Temporal |
TemporalAdder.addTo(Temporal temporal)
Adds to the specified temporal object.
|
default Temporal |
ChronoLocalDate.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date as this object.
|
Temporal |
MonthDay.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this month-day.
|
Temporal |
OffsetDate.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset and date
as this object.
|
Temporal |
YearMonth.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this year-month.
|
Temporal |
OffsetDateTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset, date
and time as this object.
|
default Temporal |
ChronoLocalDateTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same date and time as this object.
|
Temporal |
TemporalAdjuster.adjustInto(Temporal temporal)
Adjusts the specified temporal object.
|
Temporal |
OffsetTime.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same offset and time
as this object.
|
default Temporal |
Era.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have the same era as this object.
|
Temporal |
Year.adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this year.
|
boolean |
ChronoUnit.isSupported(Temporal temporal) |
default boolean |
TemporalUnit.isSupported(Temporal temporal)
Checks if this unit is supported by the specified temporal object.
|
long |
Temporal.periodUntil(Temporal endTemporal,
TemporalUnit unit)
Calculates the period between this temporal and another temporal in
terms of the specified unit.
|
long |
ChronoLocalDate.periodUntil(Temporal endDate,
TemporalUnit unit)
Calculates the period between this date and another date in
terms of the specified unit.
|
long |
OffsetDate.periodUntil(Temporal endDate,
TemporalUnit unit)
Calculates the period between this date and another date in
terms of the specified unit.
|
long |
YearMonth.periodUntil(Temporal endYearMonth,
TemporalUnit unit)
Calculates the period between this year-month and another year-month in
terms of the specified unit.
|
long |
OffsetDateTime.periodUntil(Temporal endDateTime,
TemporalUnit unit)
Calculates the period between this date-time and another date-time in
terms of the specified unit.
|
long |
OffsetTime.periodUntil(Temporal endTime,
TemporalUnit unit)
Calculates the period between this time and another time in
terms of the specified unit.
|
long |
Year.periodUntil(Temporal endYear,
TemporalUnit unit)
Calculates the period between this year and another year in
terms of the specified unit.
|
Temporal |
TemporalSubtractor.subtractFrom(Temporal temporal)
Subtracts this object from the specified temporal object.
|
Temporal |
SimplePeriod.subtractFrom(Temporal temporal)
Subtracts this period to the specified temporal object.
|