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