Hi everyone, to parse a string to a date sql valid:
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
java.util.Date date = null;
try {
date = df.parse(dateimput);
} catch (ParseException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
with dateimput is what i get from my form like that:
String dateimput=request.getParameter("datepicker");
but when running see the error:
java.text.ParseException: Format.parseObject(String) failed
at java.text.Format.parseObject(Unknown Source)
at ServletEdition.doPost(ServletEdition.java:70)
so it mean that dateimput is not known + I note that it is correctly dislayed when:
System.out.println("datepicker:" +dateimput);
Thanks.