0
我尝试Spring MVC的日期格式化器使用的粘合剂这样Spring MVC的错误日期格式
@InitBinder
public void binder(WebDataBinder binder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(true);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
但我需要格式化"dd-MM-YYYY"
。如果我用这个格式保存的MySQL错误的日期
表单数据:07-12-1980
MySQL数据:0013-05-02