|
|
@ -64,13 +64,13 @@ func isInDateSlice(t time.Time, ta TimeArrow) bool { |
|
|
|
} |
|
|
|
endStr = strings.Join(endSc, " ") |
|
|
|
|
|
|
|
startTime, err := time.Parse("2006-01-02 15:04:05", startStr) |
|
|
|
startTime, err := time.ParseInLocation("2006-01-02 15:04:05", startStr, time.Local) |
|
|
|
if err != nil { |
|
|
|
log.Println("时间段开始时间格式错误", startStr) |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|
endTime, err := time.Parse("2006-01-02 15:04:05", endStr) |
|
|
|
endTime, err := time.ParseInLocation("2006-01-02 15:04:05", endStr, time.Local) |
|
|
|
if err != nil { |
|
|
|
log.Println("时间段结束时间格式错误", startStr) |
|
|
|
continue |
|
|
@ -130,12 +130,12 @@ func isInTimeOfDay(t time.Time, ta TimeArrow) bool { |
|
|
|
start, end := tsp[0], tsp[1] |
|
|
|
start = timeCompletion(start) |
|
|
|
end = timeCompletion(end) |
|
|
|
startTime, err := time.Parse("2006-01-02 15:04:05", fmt.Sprintf("%s %s", t.Format("2006-01-02"), start)) |
|
|
|
startTime, err := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprintf("%s %s", t.Format("2006-01-02"), start), time.Local) |
|
|
|
if err != nil { |
|
|
|
log.Println("时间段开始时间格式错误", start) |
|
|
|
continue |
|
|
|
} |
|
|
|
endTime, err := time.Parse("2006-01-02 15:04:05", fmt.Sprintf("%s %s", t.Format("2006-01-02"), end)) |
|
|
|
endTime, err := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprintf("%s %s", t.Format("2006-01-02"), end), time.Local) |
|
|
|
if err != nil { |
|
|
|
log.Println("时间段结束时间格式错误", end) |
|
|
|
continue |
|
|
|