java.time.LocalDate.withYear() 方法示例 java.time.LocalDate.withMonth() 方法示例 java.time.LocalDateTime.adjustInto() 方法示例 java.time.LocalDate.withYear() 方法示例 package com.codingdict; import java.time.LocalDate; public class LocalDateDemo { public static void main(String[] args) { LocalDate date = LocalDate.parse("2017-01-03"); LocalDate result = date.withYear(2016); System.out.println(result); } } java.time.LocalDate.withMonth() 方法示例 java.time.LocalDateTime.adjustInto() 方法示例