Maybe i'm just missing the obvious, but I can't get SimpleDateTimes parse() method to work:
I want to parse dates like June 19, 2011. So, according to the documentation: http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
for my needs it should be:
M: Month in year. If the number of pattern letters is 3 or more, the month is interpreted as text; -->MMMd: Day in month. For parsing, the number of pattern letters is ignored unless it's needed to separate two adjacent fields -->dy: Year. For parsing, if the number of pattern letters is more than 2, the year is interpreted literally, regardless of the number of digits. -->yyyy
but with
SimpleDateFormat sdf = new SimpleDateFormat("MMM d, yyyy");
Date d = sdf.parse("June 19, 2011");
I'll always get java.text.ParseException: Unparseable date: "June 19, 2011"
Where am I thinking wrong? :)