Here you can find the source of compareSameDay(Calendar first, Calendar second)
public static int compareSameDay(Calendar first, Calendar second)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static int compareSameDay(Calendar first, Calendar second) { return (first.get(Calendar.YEAR) - second.get(Calendar.YEAR)) * 365 + (first.get(Calendar.MONTH) - second.get(Calendar.MONTH)) * 30 + (first.get(Calendar.DATE) - second.get(Calendar.DATE)); }/* w ww . j av a 2 s .c om*/ }