Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.Calendar; public class Main { public static boolean areSameDay(Calendar c1, Calendar c2) { if (c1 == null || c2 == null) { return false; } int y1, y2, d1, d2; y1 = c1.get(Calendar.YEAR); y2 = c2.get(Calendar.YEAR); d1 = c1.get(Calendar.DAY_OF_YEAR); d2 = c2.get(Calendar.DAY_OF_YEAR); if (y1 == y2 && d1 == d2) { return true; } return false; } }