hello i am creating an android app in which i have two string of different dates now i want to get number of years between these dates anyone please help me how i can do this? here is my code
String birthday=p.getString("BirthDay");
Log.i("bd", String.valueOf(birthday));
Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("dd MMM, yyyy");
final String formattedDate = df.format(c.getTime());
Log.i("formattedDate", String.valueOf(formattedDate));
where birthday is saved date and formatteddate is current date now i want difference between these