I need to find out the difference between a date (in yyyy-mm-dd format) and the current date.
I have written a following to find out the current date :
SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
Date now = new Date();
String strDate = sdfDate.format(now);
System.out.println("Current date:" + strDate);
String date2 = "2014-01-15";
Now i want to find out the differnce in days between strDate
and date2
. I have searched some similar posts in stack overflow, but could not able to find a solution. Any help is highly appreciable.
Thanks