在实体类上加上一个注解: @DateTimeFormat(pattern = “”); 注: 实体类中的关于时间日期的属性的类型为: java.util.Date; Mysql数据库中的关于日期的字段类型为: datetime