Java tutorial
import java.util.Calendar; public class Main { public static void main(String[] args) { Calendar old = Calendar.getInstance(); old.set(Calendar.YEAR, 2990); Calendar now = Calendar.getInstance(); System.out.println("Is old before now ? : " + old.before(now)); } }