You do not change the date format. You give a date in this format dd / mm / yyyy:
try {
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Date date = df.parse("20/02/2014");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
} catch (java.text.ParseException e) {
e.printStackTrace();
}
To change the format and have a new date, you need to use the command format
SimpleDateFormat sdf = new SimpleDateFormat("MMMM dd,yyyy");
date = sdf.format(date);
source
share