import java.util.Date; import org.springframework.format.annotation.DateTimeFormat; import com.alibaba.fastjson.annotation.JSONField; import com.fasterxml.jackson.annotation.JsonFormat; public class User { private Long id; private String username; // Date type output to page format @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8") // page string formatted as date @DateTimeFormat(pattern="yyyy-MM-dd") // code to transfer JSON format string @JSONField(format="yyyyMMdd") private Date birthday; private Integer status; //getter setter 略 }