I have two dates in string format.I need to get the difference between these two dates in days.How can I get it?I am very new to these date format.please give me any suggestion.
2017-06-13
2017-06-27
String newDate = null;
Date dtDob = new Date(GoalSelectionToDate);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
newDate = sdf.format(dtDob);
String newDate1 = null;
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
newDate1 = sdf1.format(currentDate);
System.out.println("currentdateformat"+newDate1);
System.out.println("anotherdateformat"+newDate);