Explorar o código

date time parse

ls %!s(int64=4) %!d(string=hai) anos
pai
achega
fa8512ec2f
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      util/date.go

+ 2 - 2
util/date.go

@@ -56,8 +56,8 @@ func TimeFmtStr(t time.Time, fmt string) string {
 
 // StrToDate 字符串转日期
 func StrToDate(s string) (t time.Time, err error) {
-	t, err = time.ParseInLocation(DateFmtLong, s, time.Local)
-
+	//t, err = time.ParseInLocation(DateFmtLong, s, time.Local)
+	t, err = time.Parse(DateFmtLong, s)
 	return
 }