I am getting exception java.text.ParseException
when parsing datetime input type in JSP page. I need to store date in the database but I could not.
<input type="datetime-local" required="required" name="TAT" >
Java code:
SimpleDateFormat fmt = new SimpleDateFormat("E MM-dd-yyyy 'at' hh:mm:ss a");
String parameter = request.getParameter("TAT");
Date date = fmt.parse(parameter);
System.out.println(fmt.format(date));
I could not get it as Date and time format to store.