Here you can find the source of isDayAfter(Calendar calendar, Calendar baseCalendar)
public static boolean isDayAfter(Calendar calendar, Calendar baseCalendar)
//package com.java2s; import java.util.Calendar; public class Main { public static boolean isDayAfter(Calendar calendar, Calendar baseCalendar) { if (calendar.get(Calendar.YEAR) > baseCalendar.get(Calendar.YEAR)) { return true; } else if (calendar.get(Calendar.YEAR) < baseCalendar.get(Calendar.YEAR)) { return false; }//w w w.j a v a 2s .co m if (calendar.get(Calendar.MONTH) > baseCalendar.get(Calendar.MONTH)) { return true; } else if (calendar.get(Calendar.MONTH) < baseCalendar.get(Calendar.MONTH)) { return false; } if (calendar.get(Calendar.DATE) > baseCalendar.get(Calendar.DATE)) { return true; } return false; } }