java.time.YearMonth.with() 方法示例 java.time.YearMonth.until() 方法示例 java.time.YearMonth.with(TemporalField field, long newValue) java.time.YearMonth.with() 方法示例 package com.codingdict; import java.time.YearMonth; public class YearMonthDemo { public static void main(String[] args) { YearMonth date = YearMonth.parse("2017-12"); YearMonth result = date.with(YearMonth.of(2010,12)); System.out.println(result); } } java.time.YearMonth.until() 方法示例 java.time.YearMonth.with(TemporalField field, long newValue)