java.time.ZonedDateTime.equals() 方法示例 java.time.YearMonth.withYear() 方法示例 java.time.ZonedDateTime.format() 方法示例 java.time.ZonedDateTime.equals() 方法示例 package com.codingdict; import java.time.ZonedDateTime; public class ZonedDateTimeDemo { public static void main(String[] args) { ZonedDateTime date = ZonedDateTime.parse("2017-03-28T12:13:20.408+05:30[Asia/Calcutta]"); System.out.println(date); ZonedDateTime date1 = ZonedDateTime.parse("2017-04-28T12:13:20.408+05:30[Asia/Calcutta]"); System.out.println(date1); System.out.println(date1.equals(date)); } } java.time.YearMonth.withYear() 方法示例 java.time.ZonedDateTime.format() 方法示例