public class Test {
public static void main(String[] args) {
Date date1 = new Date();
Date date2 = new Date(date1.getTime() + 1000);
System.out.println(date1.before(date2));
System.out.println(date1.compareTo(date2) == -1);
System.out.println(date1.getTime() < date2.getTime());
}
}