import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class HelloWorld{
public static void main(String []args){
String s = "Sep 01, 2014 6:30 pm";
SimpleDateFormat timeFormat = new SimpleDateFormat("MMM dd, YYYY hh:mm a", Locale.US);
try{
Date startTime = timeFormat.parse(s);
System.out.println(startTime);
}catch(Exception e){}
}
}
The result given is Sun Dec 29 18:30:00 CST 2013, which is totally wrong
Please help!!