I'm trying to convert a string to a date. I've got an example here with the input string as hardcoded string.
try {
String currentDate = "Tue Jan 05 21:19:57 CET 2016";
Date d = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US).parse(currentDate);
} catch (ParseException e) {
e.printStackTrace();
}
For some reason, this throws the following exception:
ParseException: Unparseable date: "Tue Jan 05 21:19:57 CET 2016" (at offset 20)
Could someone help me with this problem? Thanks!