I am trying to convert a date of MMM, dd yyyy to a format of dd/mm/yyyy in order to update a date picker but I get an error in parse method on the following:
SimpleDateFormat format = new SimpleDateFormat("MMM, dd yyyy");
Date newDate = format.**parse**(strCurrentDate);
format = new SimpleDateFormat("dd/MM/yyyy");
String date = format.format(newDate);
and
String str[] = date.split("/");
int myday = Integer.parseInt(str[0]);
int mymonth = Integer.parseInt(str[1]);
int myyear = Integer.parseInt(str[2]);
dp.updateDate(myday,mymonth,myyear);
What I am doing wrong here? Should I enclose it with try / catch? thank you