A String dateString = "2012/06/05";
Date date = new SimpleDateFormat("yyyy/MM/dd").parse(dateString);
SimpleDateFormat sdf = new SimpleDateFormat("dd - MM - yyyy");
System.out.println(sdf.format(date));
B String dateString = "2012/06/05";
Date date = new SimpleDateFormat("yyyy/MM/dd").format(dateString); SimpleDateFormat sdf = new SimpleDateFormat("dd - MM - yyyy"); System.out.println(sdf.parse(date));
C String dateString = "2012/06/05";
Date date = new SimpleDateFormat("dd - MM - yyyy").format(dateString);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
System.out.println(sdf.parse(date));
D String dateString = "2012/06/05";
Date date = new SimpleDateFormat("dd - MM - yyyy").parse(dateString);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
System.out.println(sdf.format(date));