go将时间转为想要的格式,且时间还是time类型
currTime :=time.Now().Format("2006-01-02 15:04:05") local, _ := time.LoadLocation("Local") t, _ := time.ParseInLocation("2006-01-02 15:04:05", currTime, local) fmt.Println(t)
currTime :=time.Now().Format("2006-01-02 15:04:05") local, _ := time.LoadLocation("Local") t, _ := time.ParseInLocation("2006-01-02 15:04:05", currTime, local) fmt.Println(t)