Hi wanted to get the number of days in between dates.
Below is the logic I tried
final Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 1);
final Date endDate = cal.getTime();
final Date currentDate = new Date();
System.out.println(TimeUnit.MILLISECONDS.toDays(endDate.getTime() - currentDate.getTime()));
It is always printing 0. Expectation is to print 1. Any ideas?