I have a string ="02/07/2015 5:10 PM";
I need a string date with format as: 2015-02-07 17:10:00;
How can i achieve this?
I have tried with:
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm");
Date datepicker1 = dateFormat.parse(datetime1);
Then
SimpleDateFormat dateFormat1 = new SimpleDateFormat("dd/MM/yyyy' 'HH:mm:ss");
String datetimepicker1 = dateFormat1.format(datepicker1);
But finally I get is: 2015-02-08 05:10:00
and I need 2015-02-08 17:10:00
.