Kaynağa Gözat

时间格式化

Aslee 3 yıl önce
ebeveyn
işleme
cf3d68fdad

+ 4 - 3
src/main/java/com/caimei/www/pojo/baike/BaikeProduct.java

@@ -2,6 +2,7 @@ package com.caimei.www.pojo.baike;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.util.Date;
@@ -68,7 +69,7 @@ public class BaikeProduct implements Serializable {
     /**
      * 上市时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date marketTime;
     /**
      * 公司/厂商
@@ -77,7 +78,7 @@ public class BaikeProduct implements Serializable {
     /**
      * NMPA认证时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date nmpaTime;
     /**
      * 适应人群
@@ -94,7 +95,7 @@ public class BaikeProduct implements Serializable {
     /**
      * 发布时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     /**
      * 是否置顶标识:0否,1是