Android examples for java.util:Day
is Same Day by converting date to string
import android.util.Log; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Map; public class Main{ public static boolean isSameDay(Date date1, Date date2) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String ds1 = sdf.format(date1); String ds2 = sdf.format(date2); if (ds1.equals(ds2)) { return true; } else {/*from www .j av a2 s . c o m*/ return false; } } }