import java.text.SimpleDateFormat;
import java.util.Date;
class Main{
public static int compareToSecond(Date date1, Date date2) {
if (date1 == null || date2 == null) {
return 0;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
return sdf.format(date1).compareTo(sdf.format(date2));
}
}