软件包 | 描述 |
---|---|
java.time |
日期、时间、时刻主要的API,和持续时间。
|
java.time.chrono |
除了默认的标准以外的日历系统的通用的。
|
java.time.format |
提供打印和解析日期和时间的类。
|
Modifier and Type | Field and Description |
---|---|
static Period |
Period.ZERO
一个常数为零的周期。
|
Modifier and Type | Method and Description |
---|---|
static Period |
Period.between(LocalDate startDateInclusive, LocalDate endDateExclusive)
获得由年数
Period 月,和两个日期之间的天数。
|
static Period |
Period.from(TemporalAmount amount)
获得
Period 实例从一个时间量。
|
Period |
Period.minus(TemporalAmount amountToSubtract)
返回此期间的一个副本,与指定的周期减去。
|
Period |
Period.minusDays(long daysToSubtract)
返回此期间的一个副本,用指定的天数减去。
|
Period |
Period.minusMonths(long monthsToSubtract)
返回这个周期的一个副本,用指定的月减去。
|
Period |
Period.minusYears(long yearsToSubtract)
返回此期间的一个副本,用指定的年份减去。
|
Period |
Period.multipliedBy(int scalar)
返回一个新的实例,在这个周期中的每个元素乘以指定的标量。
|
Period |
Period.negated()
在这期间的每一笔收益的一个新实例否定。
|
Period |
Period.normalized()
返回此期间的副本与数年和几个月的正常化。
|
static Period |
Period.of(int years, int months, int days)
获得
Period 代表数年、月和日。
|
static Period |
Period.ofDays(int days)
获得
Period 代表天数。
|
static Period |
Period.ofMonths(int months)
获得
Period 代表月数。
|
static Period |
Period.ofWeeks(int weeks)
获得
Period 代表数周。
|
static Period |
Period.ofYears(int years)
获得
Period 代表数年。
|
static Period |
Period.parse(CharSequence text)
从一个文本字符串,如
PnYnMnD 一
Period 。
|
Period |
Period.plus(TemporalAmount amountToAdd)
返回此期间的副本,添加指定的周期。
|
Period |
Period.plusDays(long daysToAdd)
返回此期间的副本,添加指定的日期。
|
Period |
Period.plusMonths(long monthsToAdd)
返回此期间的副本,添加指定的月份。
|
Period |
Period.plusYears(long yearsToAdd)
返回此期间的副本,添加指定的年份。
|
Period |
LocalDate.until(ChronoLocalDate endDateExclusive)
计算这个日期和日期之间的时间作为一个
Period 。
|
Period |
Period.withDays(int days)
返回此期间的一个副本与指定的天数。
|
Period |
Period.withMonths(int months)
返回此期间的副本与指定的月数。
|
Period |
Period.withYears(int years)
用指定的金额返回此期间的副本。
|
Modifier and Type | Method and Description |
---|---|
Period |
IsoChronology.period(int years, int months, int days)
根据几年、几个月和几天的时间来获得这个年代的一段时间。
|
Modifier and Type | Method and Description |
---|---|
static TemporalQuery<Period> |
DateTimeFormatter.parsedExcessDays()
提供了对被解析过的多余天数的查询。
|
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.