java.time.LocalDateTime.adjustInto() 方法示例 java.time.LocalDate.withYear() 方法示例 java.time.LocalDateTime.atOffset() 方法示例 java.time.LocalDateTime.adjustInto() 方法示例 package com.codingdict; import java.time.LocalDateTime; import java.time.ZonedDateTime; public class LocalDateTimeDemo { public static void main(String[] args) { ZonedDateTime date = ZonedDateTime.now(); System.out.println(date); LocalDateTime date1 = LocalDateTime.parse("2017-02-03T12:30:30"); date = (ZonedDateTime)date1.adjustInto(date); System.out.println(date); } } java.time.LocalDate.withYear() 方法示例 java.time.LocalDateTime.atOffset() 方法示例