public static boolean isBeforeToday1(String strDate,String endDate)
{
SimpleDateFormat dfDate = new SimpleDateFormat("yyyy-MM-dd");
boolean b = false;
try {
if (dfDate.parse(strDate).before(dfDate.parse(endDate)))
{
b = true; // If start date is before end date.
} else if (dfDate.parse(strDate).equals(dfDate.parse(endDate)))
{
b = false; // If two dates are equal.
} else
{
b = false; // If start date is after the end date.
}
} catch (ParseException e) {
e.printStackTrace();
}
return b;
}
No comments:
Post a Comment