var formatArr = []string{"2006-01-02 15:04:05", "2006-01-02T15:04:05","2006-01-02T15:04:05Z", "Jan 02 15:04:05 2006 GMT", "1月 02 15:04:05 2006 GMT"}// StrToDate 时间转换 func StrToDate(dateStr string) time.Time {dateStr = strings.TrimSpace(dateStr)if len(dateStr) == 0 {return time.Time{}}for _, format := range formatArr {dateTime, err := time.ParseInLocation(format, strings.TrimSpace(dateStr), time.Local)if err != nil {continue}return dateTime}return time.Time{} }