I have a problem with my Datapicker
i use the code for getting date,month & year shown below
DatePicker datePicker;
datePicker
You can format the date like this :
int day = datePicker.getDayOfMonth();
int month= datePicker.getMonth();
int year = datePicker.getYear();
Calendar calendar = Calendar.getInstance();
calendar.set(year, month, day);
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
String formatedDate = sdf.format(calendar.getTime());
You can parse the String back to Date object by calling
Date date = sdf.parse(formatedDate);