I need to parse a string like "February 12, 1981" as a date. I am using SimpleDateFormat . But if I do this:
new SimpleDateFormat("MMMMM dd, yyyy").parse("February 12, 1981")
I get java.text.ParseException.
I tried to reduce it to see where the problem is. Firstly:
new SimpleDateFormat("MMMMM").parse("February")
works. Then:
new SimpleDateFormat("MMMMM dd").parse("February 12")
does not work any more. Does anyone know why? I also tried new SimpleDateFormat("MMMMM' 'dd") .
I am using JRE 1.6.0_06.
source share