Java tutorial
import java.util.Date; public class Main { public static void main(String[] args) { Date date = new Date(); Date date2 = new Date(); boolean before = date2.before(date); System.out.println(before); before = date.before(date2); System.out.println(before); } }