Here you can find the source of isSameInstant(Calendar cal1, Calendar cal2)
public static boolean isSameInstant(Calendar cal1, Calendar cal2)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isSameInstant(Date date1, Date date2) { if (date1 == null || date2 == null) { throw new IllegalArgumentException("The date must not be null"); }//from w w w.j a va 2s . co m return date1.getTime() == date2.getTime(); } public static boolean isSameInstant(Calendar cal1, Calendar cal2) { if (cal1 == null || cal2 == null) { throw new IllegalArgumentException("The date must not be null"); } return cal1.getTime().getTime() == cal2.getTime().getTime(); } }