I have a problem with my Datapicker
i use the code for getting date,month & year shown below
DatePicker datePicker;
datePicker
Starting from API level 12, DatePicker
has public CalendarView getCalendarView ()
, using this view you can get the date:
long dateTime = datePicker.getCalendarView().getDate();
Date date = new Date(dateTime);
Then format if needed:
DateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy");
String formattedDate = dateFormat.format(date);