Below is my code
Date currentDate = new Date();
DateFormat dateFormatCmp = new SimpleDateFormat("yyyy-MM-dd");
if(dateFormatCmp.format(currentDate).equals(dateFormatCmp.format(task.getExecutionDate())))
{
//doSomething here
}
current date is having value - 2014-12-02 and task.getExecutionDate() is having value 2014-12-05
Even then it is entering into if condition. Date comparison is not done properly.