public static void main(String[] args) throws ParseException {
String firstDate = "2021-07-12 09:52:30";
String secondDate = "2021-07-14 17:35:16";
SimpleDateFormat sf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (sf.parse(firstDate).getTime()< sf.parse(secondDate).getTime()) {
System.out.println("firstDate 时间 小于 secondDate 时间 " );
}else {
System.out.println("firstDate 时间 大于 secondDate 时间 " );
}
}