public static int isToday(Date date) {
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
if (date == null) {
return 0;
}
Date now = new Date();
if (GlobalMethod.isSameDay(now, date)) {//(fmt.format(date).toString().equals(fmt.format(now).toString()))
return 1;
} else {
return 0;
}
}
static public boolean isSameDay(Date dt1,Date dt2)
{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
String strDate1 = format.format(dt1);
String strDate2 = format.format(dt2);
return strDate1.equalsIgnoreCase(strDate2);
}