Basically I've:
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String ActualDate = "2017-01-05";
LocalDate dt = LocalDate.parse(ActualDate, formatter);
LocalDateTime currentdate = LocalDateTime.now();
String datetocheckstr = currentdate.toString().substring(0, 10);
LocalDate datetochkbetween = LocalDate.parse(datetocheckstr, formatter);
long DAYS = ChronoUnit.DAYS.between(datetochkbetween, dt);
This pretty much works and show you the amount of days between the ActualDate
and now
.
Now I need to convert it to Years, Months, And days.
So if My ActualDate = "2015-02-15"
and Now It's 2017-03-27
the output I need to get is to be: 2 Years 1 Month and 12 Days
.
Peace be upon us all