gmy 2 сар өмнө
parent
commit
8262cfaf9f
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      utils/date_util.go

+ 1 - 1
utils/date_util.go

@@ -111,7 +111,7 @@ func isLeap(year int) bool {
 
 // StringToTime string 类型时间 转换为 time.Time 类型
 func StringToTime(date string) time.Time {
-	t, _ := time.Parse("2006-01-02", date)
+	t, _ := time.ParseInLocation("2006-01-02", date, time.Local)
 	return t
 }