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.lang.IllegalArgumentException
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
Date date = new Date(values);
String mydate = dateFormat.format(date);
First you have to parse the string representation of your date-time into a Date object.
Then you format the Date object back into a String in your preferred format.