I have a string in "dd-MM-yyyy HH: mm" and you need to convert it to a date object in the format "yyyy-MM-dd HH: mm".
Below is the code I use to convert
oldScheduledDate = "16-05-2011 02:00:00";
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date oldDate = (Date)formatter.parse(oldScheduledDate);
Now when I print oldDate, I get
Sat Nov 01 02:00:00 GMT 21What is completely wrong, what am I doing wrong here?
Vivek source
share