Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static boolean isCurrentDate(Calendar comparedDate) { Calendar cal = Calendar.getInstance(); int[] comparedElements = { Calendar.YEAR, Calendar.MONTH, Calendar.DAY_OF_MONTH }; for (int elem : comparedElements) { if (cal.get(elem) != comparedDate.get(elem)) { return false; } } return true; } }