Browse Source

修改显示时间

xiexiaoyuan 2 years ago
parent
commit
5dbbeba6ea
1 changed files with 2 additions and 2 deletions
  1. 2 2
      services/report/report.go

+ 2 - 2
services/report/report.go

@@ -729,7 +729,7 @@ func GetReportList(user user.UserInfo, keyWord string, classifyIdFirst, classify
 				temp.Stage = stageInt
 				temp.StageStr = reportItem.StageStr
 				temp.Title = reportItem.Title
-				temp.PublishTime, err = time.Parse("2006-01-02 15:04:05", reportItem.PublishTime)
+				temp.PublishTime, err = time.ParseInLocation(utils.FormatDateTime, reportItem.PublishTime, time.Local)
 				if len(v.Highlight["Title"]) > 0 {
 					temp.Title = v.Highlight["Title"][0]
 				}
@@ -1013,7 +1013,7 @@ func SearchReport(user user.UserInfo, keyWord string, pageIndex, pageSize int) (
 			temp.ClassifyNameSecond = reportItem.ClassifyNameSecond
 			temp.Title = reportItem.Title
 			temp.ContentSub = reportItem.BodyContent
-			temp.PublishTime, err = time.Parse("2006-01-02 15:04:05", reportItem.PublishTime)
+			temp.PublishTime, err = time.ParseInLocation(utils.FormatDateTime, reportItem.PublishTime,time.Local)
 
 			if len(v.Highlight["Title"]) > 0 {
 				temp.Title = v.Highlight["Title"][0]