类的用途
java.time.Year
使用 Year 的包
-
Year 在 java.time 中的用法
修饰符和类型方法描述static YearYear.from(TemporalAccessor temporal) 从时间对象中获取Year的实例。Year.minus(long amountToSubtract, TemporalUnit unit) 返回减去指定数量的今年的副本。Year.minus(TemporalAmount amountToSubtract) 返回减去指定数量的今年的副本。Year.minusYears(long yearsToSubtract) 返回此Year的副本,并减去指定的年数。static YearYear.now()从默认时区的系统时钟获取当前年份。static Year从指定时钟获取当前年份。static Year从指定时区的系统时钟获取当前年份。static YearYear.of(int isoYear) 获得Year的实例。static YearYear.parse(CharSequence text) 从2007等文本字符串中获取Year的实例。static YearYear.parse(CharSequence text, DateTimeFormatter formatter) 使用特定格式化程序从文本字符串中获取Year的实例。Year.plus(long amountToAdd, TemporalUnit unit) 返回添加了指定数量的今年的副本。Year.plus(TemporalAmount amountToAdd) 返回添加了指定数量的今年的副本。Year.plusYears(long yearsToAdd) 返回此Year的副本,并添加了指定的年数。Year.with(TemporalAdjuster adjuster) 返回今年的调整副本。Year.with(TemporalField field, long newValue) 返回今年的副本,并将指定字段设置为新值。