真正解决日期格式!!!java bean与mysql对应!

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String birthday;//生日

图中的注解依赖为:
com.fasterxml.jackson.annotation
org.springframework.format.annotation

图中String类型也可以改为java.util.Date,注意别导成sql包

猜你喜欢

转载自blog.csdn.net/g_y_x_/article/details/85273267