I am getting a parsing error with the following code
String time = "24 Apr 2021 11:56:44";
Date timeOnLine = new SimpleDateFormat("dd MMM yyyy HH:mm:ss").parse(time);
Exception:
java.text.ParseException: Unparseable date: "24 Apr 2021 11:56:44"
I am not sure what the problem is since the pattern seems to correspond with the string correctly.
Any advice on how to solve would be greatly appreciated!
SimpleDateFormatandDate. Those classes are poorly designed and long outdated, the former in particular notoriously troublesome. Instead useLocalDateTimeandDateTimeFormatter, both from java.time, the modern Java date and time API.