I am stuck at very simple problem.I have a string in which time is stored in yyyy-MM-dd hh:mm:ss format.
What I need is to convert that string in Date class's object.So it is obvious that I shuild use SimpleDateFormat class
I create the object of that class and use it's parse method.I have written it in try catch block and it is showing Parsing error's exception.
What I have done is...
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss aa");
java.util.Date dt=sdf.parse("2010-03-31 11:00:00");
System.out.println("Converted date is --> "+dt);