I have a two dates that are of string type. How do I count how many days there are not considering milliseconds?
This code gives me the number of milliseconds between the dates:
try {
SimpleDateFormat myFormat = new SimpleDateFormat("yyyy-MM-dd");
String inputString1 = 23-11-2018;
String inputString2 = 24-11-2018;
Date date1 = myFormat.parse(inputString1);
Date date2 = myFormat.parse(inputString2);
diff = date2.getTime() - date1.getTime();
} catch (ParseException e) {
e.printStackTrace();
}