I am trying to get Java to read in a date formatted as follows: Thu Mar 8 13:33:25 2012 But getting an unparseable exception. Here's the code:
SimpleDateFormat formatter2 = new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy", Locale.ENGLISH);
String currentDate = "Thu Mar 8 13:33:25 2012";
Date date2 = formatter.parse(currentDate);
It throws the following exception: Exception in thread "main" java.text.ParseException: Unparseable date: "Thu Mar 8 13:33:25 2012"
Could someone help me out please? I've tried changing the "d" to "dd" but still doesn't work.