datetimeformat和jsonformat的区别
package com.example.bryangp.web.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class Student {
private String name;
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
private Date birth;
@DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date date;
}