I am doing the following
SimpleDateFormat formatter = new SimpleDateFormat(“MM-dd-yyyy”);
calendar.setTime(formatter.parse(“01/26/2012”);
When I do
calendar.getTime()
I see
java.text.ParseException: Unparseable date: “01/26/2012”
What is am I doing wrong?
Thank you
Erm, you give the pattern
to
SimpleDateFormatthen offer itto parse. That’s not the format you specified, and it’s telling you it can’t parse it.
You would need: