I'm trying to parse a string to date object in Java.
My string is: String date = 2013-04-13 21:00:00;
The code is:
String myFormatString = "yyyy-mm-dd hh:mm:ss";
Date date1 = new SimpleDateFormat(myFormatString, Locale.ENGLISH).parse(date);
System.out.println(date1);
I'm expecting the output to be: Sun Apr 13 21:00:00 GMT+00:00 2013
but what I get is: Sun Jan 13 21:00:00 GMT+00:00 2013
Can you see why?