用@InitBinder
public void initBinder(ServletRequestDataBinder binder) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
}
可以转换一种格式,怎么转换两种格式的
参考:https://blog.csdn.net/eumenides_/article/details/79033505