I am trying to convert date which is in string and got format of \"yyyy-MM-dd HH:mm:ss\" to \"dd-MM-yyyy\".
I have implmented following code but its giving : java.
The IllegalArgumentException probably occurs when program trying to construct Date object
What's the value ?
Following code snippet runs correctly.
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date date = new Date();
String mydate = dateFormat.format(date);
System.out.println(mydate);
Output :
29/11/2011