Java tutorial
//package com.java2s; import java.util.Calendar; public class Main { public static boolean equals(Calendar cal1, Calendar cal2) { int year1 = cal1.get(Calendar.YEAR); int dayOfYear1 = cal1.get(Calendar.DAY_OF_YEAR); int year2 = cal2.get(Calendar.YEAR); int dayOfYear2 = cal2.get(Calendar.DAY_OF_YEAR); return year1 == year2 && dayOfYear1 == dayOfYear2; } }