软件包 | 描述 |
---|---|
java.time |
日期、时间、时刻主要的API,和持续时间。
|
Modifier and Type | Method and Description |
---|---|
static Year |
Year.from(TemporalAccessor temporal)
获得
Year 实例从一个时空对象。
|
Year |
Year.minus(long amountToSubtract, TemporalUnit unit)
以指定的金额减去该年的副本。
|
Year |
Year.minus(TemporalAmount amountToSubtract)
以指定的金额减去该年的副本。
|
Year |
Year.minusYears(long yearsToSubtract)
返回今年的副本,用指定的年数减去。
|
static Year |
Year.now()
从默认时区中的系统时钟获取当前年份。
|
static Year |
Year.now(Clock clock)
从指定的时钟获取当前年份。
|
static Year |
Year.now(ZoneId zone)
从指定时区中的系统时钟获取当前年份。
|
static Year |
Year.of(int isoYear)
获得
Year 实例。
|
static Year |
Year.parse(CharSequence text)
获得
Year 实例从一个文本字符串,如
2007 。
|
static Year |
Year.parse(CharSequence text, DateTimeFormatter formatter)
获得
Year 实例从使用特定格式的文本字符串。
|
Year |
Year.plus(long amountToAdd, TemporalUnit unit)
返回一个今年的副本与指定的金额添加。
|
Year |
Year.plus(TemporalAmount amountToAdd)
返回一个今年的副本与指定的金额添加。
|
Year |
Year.plusYears(long yearsToAdd)
返回本年的副本,添加指定的年数。
|
Year |
Year.with(TemporalAdjuster adjuster)
返回今年调整后的副本。
|
Year |
Year.with(TemporalField field, long newValue)
将今年的副本与指定的字段设置为一个新值。
|
Modifier and Type | Method and Description |
---|---|
int |
Year.compareTo(Year other)
今年比另一年。
|
boolean |
Year.isAfter(Year other)
是今年指定的一年后。
|
boolean |
Year.isBefore(Year other)
是今年前指定的一年。
|
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.