软件包 | 描述 |
---|---|
java.time |
日期、时间、时刻主要的API,和持续时间。
|
java.time.chrono |
除了默认的标准以外的日历系统的通用的。
|
java.time.temporal |
访问日期和时间的应用领域和单位,时间和日期的调节。
|
Modifier and Type | Class and Description |
---|---|
class |
Instant
时间线上的一个瞬时点。
|
class |
LocalDate
一个没有在ISO-8601日历系统时区的日期,如
2007-12-03 。
|
class |
LocalDateTime
一个没有在ISO-8601日历系统时区的日期时间,如
2007-12-03T10:15:30 。
|
class |
LocalTime
一时间没有时间带在ISO-8601日历系统,如
10:15:30 。
|
class |
OffsetDateTime
一个UTC偏移量/格林尼治在ISO-8601日历系统日期时间,如
2007-12-03T10:15:30+01:00 。
|
class |
OffsetTime
与UTC偏移量/格林尼治在ISO-8601日历系统的时间,如
10:15:30+01:00 。
|
class |
Year
在ISO-8601日历系统一年,如
2007 。
|
class |
YearMonth
一年中的ISO-8601日历系统月,如
2007-12 。
|
class |
ZonedDateTime
一个在ISO-8601日历系统时区的日期时间,如
2007-12-03T10:15:30+01:00 Europe/Paris 。
|
Modifier and Type | Method and Description |
---|---|
Temporal |
Period.addTo(Temporal temporal)
将此时间添加到指定的时间对象。
|
Temporal |
Duration.addTo(Temporal temporal)
将此持续时间添加到指定的时间对象。
|
Temporal |
MonthDay.adjustInto(Temporal temporal)
调整指定的时间对象有这个月天。
|
Temporal |
Instant.adjustInto(Temporal temporal)
调整指定的时间对象有这一瞬间。
|
Temporal |
OffsetTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的偏移和时间为这个对象。
|
Temporal |
OffsetDateTime.adjustInto(Temporal temporal)
调整指定的时间对象以具有相同的偏移量、日期和时间为对象。
|
Temporal |
LocalTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的时间为这个对象。
|
Temporal |
LocalDate.adjustInto(Temporal temporal)
调整指定的时间对象,以具有此对象的相同日期。
|
Temporal |
DayOfWeek.adjustInto(Temporal temporal)
调整指定的时间对象有一周的这一天。
|
Temporal |
YearMonth.adjustInto(Temporal temporal)
调整指定的时间对象有今年一个月。
|
Temporal |
LocalDateTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的日期和时间为对象。
|
Temporal |
Month.adjustInto(Temporal temporal)
调整指定的时间对象有这个月的一年。
|
Temporal |
ZoneOffset.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的偏移量为这个对象。
|
Temporal |
Year.adjustInto(Temporal temporal)
调整指定的时间对象,以有今年。
|
Temporal |
Period.subtractFrom(Temporal temporal)
从指定的对象减去这段时间。
|
Temporal |
Duration.subtractFrom(Temporal temporal)
从指定的时空对象中减去这个时间。
|
Modifier and Type | Method and Description |
---|---|
Temporal |
Period.addTo(Temporal temporal)
将此时间添加到指定的时间对象。
|
Temporal |
Duration.addTo(Temporal temporal)
将此持续时间添加到指定的时间对象。
|
Temporal |
MonthDay.adjustInto(Temporal temporal)
调整指定的时间对象有这个月天。
|
Temporal |
Instant.adjustInto(Temporal temporal)
调整指定的时间对象有这一瞬间。
|
Temporal |
OffsetTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的偏移和时间为这个对象。
|
Temporal |
OffsetDateTime.adjustInto(Temporal temporal)
调整指定的时间对象以具有相同的偏移量、日期和时间为对象。
|
Temporal |
LocalTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的时间为这个对象。
|
Temporal |
LocalDate.adjustInto(Temporal temporal)
调整指定的时间对象,以具有此对象的相同日期。
|
Temporal |
DayOfWeek.adjustInto(Temporal temporal)
调整指定的时间对象有一周的这一天。
|
Temporal |
YearMonth.adjustInto(Temporal temporal)
调整指定的时间对象有今年一个月。
|
Temporal |
LocalDateTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的日期和时间为对象。
|
Temporal |
Month.adjustInto(Temporal temporal)
调整指定的时间对象有这个月的一年。
|
Temporal |
ZoneOffset.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的偏移量为这个对象。
|
Temporal |
Year.adjustInto(Temporal temporal)
调整指定的时间对象,以有今年。
|
static Duration |
Duration.between(Temporal startInclusive, Temporal endExclusive)
获得
Duration 表示两个时间对象之间的时间。
|
Temporal |
Period.subtractFrom(Temporal temporal)
从指定的对象减去这段时间。
|
Temporal |
Duration.subtractFrom(Temporal temporal)
从指定的时空对象中减去这个时间。
|
long |
Instant.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个时刻为止。
|
long |
OffsetTime.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到另一个时间在指定的单位。
|
long |
OffsetDateTime.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个日期时间。
|
long |
LocalTime.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到另一个时间在指定的单位。
|
long |
LocalDate.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个日期为止。
|
long |
YearMonth.until(Temporal endExclusive, TemporalUnit unit)
计算时间的数量,直到另一个月的指定单位。
|
long |
LocalDateTime.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个日期时间。
|
long |
ZonedDateTime.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个日期时间。
|
long |
Year.until(Temporal endExclusive, TemporalUnit unit)
计算时间的数量,直到指定的单位计算一年。
|
Modifier and Type | Interface and Description |
---|---|
interface |
ChronoLocalDate
一个没有时间的天或时间区的日期,在一个任意的年代,用于先进的全球化用例。
|
interface |
ChronoLocalDateTime<D extends ChronoLocalDate>
一个没有时间区的日期时间,在一个任意的年代,用于先进的全球化用例。
|
interface |
ChronoZonedDateTime<D extends ChronoLocalDate>
一个时间区的日期时间,在一个任意的年代,用于先进的全球化用例。
|
Modifier and Type | Class and Description |
---|---|
class |
HijrahDate
在迁徙的日历系统日期。
|
class |
JapaneseDate
日本帝国日历系统中的日期。
|
class |
MinguoDate
在民国历法日期。
|
class |
ThaiBuddhistDate
泰国佛教日历系统中的日期。
|
Modifier and Type | Method and Description |
---|---|
Temporal |
ChronoPeriod.addTo(Temporal temporal)
将此时间添加到指定的时间对象。
|
default Temporal |
ChronoLocalDate.adjustInto(Temporal temporal)
调整指定的时间对象,以具有此对象的相同日期。
|
default Temporal |
ChronoLocalDateTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的日期和时间为对象。
|
default Temporal |
Era.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的时代为这个对象。
|
Temporal |
ChronoPeriod.subtractFrom(Temporal temporal)
从指定的对象减去这段时间。
|
Modifier and Type | Method and Description |
---|---|
Temporal |
ChronoPeriod.addTo(Temporal temporal)
将此时间添加到指定的时间对象。
|
default Temporal |
ChronoLocalDate.adjustInto(Temporal temporal)
调整指定的时间对象,以具有此对象的相同日期。
|
default Temporal |
ChronoLocalDateTime.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的日期和时间为对象。
|
default Temporal |
Era.adjustInto(Temporal temporal)
调整指定的时间对象,以具有相同的时代为这个对象。
|
Temporal |
ChronoPeriod.subtractFrom(Temporal temporal)
从指定的对象减去这段时间。
|
long |
ChronoLocalDate.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个日期为止。
|
Modifier and Type | Method and Description |
---|---|
<R extends Temporal> |
ChronoUnit.addTo(R temporal, long amount) |
<R extends Temporal> |
TemporalUnit.addTo(R temporal, long amount)
返回指定的时间对象的副本,添加指定的时间。
|
<R extends Temporal> |
ChronoField.adjustInto(R temporal, long newValue) |
<R extends Temporal> |
TemporalField.adjustInto(R temporal, long newValue)
返回一个指定的时间对象的副本,此字段集的值为。
|
Modifier and Type | Method and Description |
---|---|
Temporal |
TemporalAmount.addTo(Temporal temporal)
添加到指定的时间对象。
|
Temporal |
TemporalAdjuster.adjustInto(Temporal temporal)
调整指定的时间对象。
|
default Temporal |
Temporal.minus(long amountToSubtract, TemporalUnit unit)
返回与指定期间减去的相同类型的对象。
|
default Temporal |
Temporal.minus(TemporalAmount amount)
返回一个与此对象相同的类型的对象,该对象的金额减去。
|
Temporal |
Temporal.plus(long amountToAdd, TemporalUnit unit)
返回与此对象相同的类型的对象,添加指定的周期。
|
default Temporal |
Temporal.plus(TemporalAmount amount)
返回与此对象添加的相同类型的对象。
|
Temporal |
TemporalAmount.subtractFrom(Temporal temporal)
从指定的时空对象中减去这个对象。
|
default Temporal |
Temporal.with(TemporalAdjuster adjuster)
返回与此对象调整的相同类型的调整对象。
|
Temporal |
Temporal.with(TemporalField field, long newValue)
返回与指定字段更改的相同类型的对象。
|
Modifier and Type | Method and Description |
---|---|
Temporal |
TemporalAmount.addTo(Temporal temporal)
添加到指定的时间对象。
|
Temporal |
TemporalAdjuster.adjustInto(Temporal temporal)
调整指定的时间对象。
|
long |
ChronoUnit.between(Temporal temporal1Inclusive, Temporal temporal2Exclusive) |
long |
TemporalUnit.between(Temporal temporal1Inclusive, Temporal temporal2Exclusive)
计算两个时间对象之间的时间量。
|
boolean |
ChronoUnit.isSupportedBy(Temporal temporal) |
default boolean |
TemporalUnit.isSupportedBy(Temporal temporal)
检查该单位是否被指定的时间对象支持。
|
Temporal |
TemporalAmount.subtractFrom(Temporal temporal)
从指定的时空对象中减去这个对象。
|
long |
Temporal.until(Temporal endExclusive, TemporalUnit unit)
计算时间的量,直到指定单元的另一个时间。
|
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, 2014, Oracle and/or its affiliates. All rights reserved.