I am trying to parse a date returned from an API. An example date looks like "20180314110343". The API document says the date format is yyyymmddhh24miss. However, when I try to parse using this format, I get the below error.
java.lang.IllegalArgumentException: Illegal pattern character 'i'
I tried parsing using the following code. But, I am getting a java.text.ParseException. What is the proper way to parse this date?
Code
DateFormat format = new SimpleDateFormat("yyyymmddhh24mmss");
String.valueOf(format.parse(dateVariable)
Error
java.text.ParseException: Unparseable date: "20201116135151"