Determine whether two dates are equal in Java 8
package com.shxt.demo02; import java.time.LocalDate; public class Demo04 { public static void main(String[] args) { LocalDate date1 = LocalDate.now(); LocalDate date2 = LocalDate.of(2018,2,5); if(date1.equals(date2)){ System.out.println("时间相等"); } else{ System.out.println("时间不等"); } } }
The above is the detailed content of How to determine whether two dates are equal in Java8. For more information, please follow other related articles on the PHP Chinese website!