its an age calculator project I need to know how to convert multiple EditText values into one date String in an android studio? keep in mind I am using "joda-time library" it's not showing the result. I don't know where I did a mistake! I have forgotten everything I can not fix now hope you guys can help me with that. thanks
public void dateOfBirth(){
String day = editTextDay.getText().toString().trim();
String month = editTextMonth.getText().toString().trim();
String year = editTextYear.getText().toString().trim();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
String sDate = day+"/"+month+"/"+year;
long date = System.currentTimeMillis();
String eDate = simpleDateFormat.format(date);
try {
Date date1 = simpleDateFormat.parse(sDate);
Date date2 =simpleDateFormat.parse(eDate);
/* long eDate = System.currentTimeMillis();
Date date2 = simpleDateFormat.parse(String.valueOf((eDate)));*/
long startDate = date1.getTime();
long endDate =date2.getTime();
if (startDate<=endDate){
Period period = new Period(startDate, endDate, PeriodType.yearMonthDay());
int years = period.getYears();
int months =period.getMonths();
int days = period.getDays();
textViewDay.setText(days);
textViewMonth.setText(months);
textViewYear.setText(years);
}
} catch (ParseException e) {
e.printStackTrace();
}
}