Ex -
String dob = "05/02/1989"; //its in MM/dd/yyyy
String newDate = null;
Date dtDob = new Date(dob);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
newDate = sdf.format(dtDob);
} catch (ParseException e) {}
System.out.println(newDate); //Output is 1989-05-02