golang 基于时间比较 加上时区
timezone := time.FixedZone("CST", 8*3600)
start, end := "2022-06-09 21:17:47", "2022-06-19 10:55:34"
startTime, err := time.ParseInLocation(formatTime, start, timezone)
if err != nil {
panic(err)
}
endTime, _ := time.ParseInLocation(formatTime, end, timezone)
if err != nil {
panic(err)
}
nowTimestamp := time.Now().In(timezone).Unix()
startTimestamp := startTime.Unix()
endTimestamp := endTime.Unix()