0

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.

ZygD
  • 22,092
  • 39
  • 79
  • 102
sips
  • 1
  • 3

0 Answers0