This commit is contained in:
shoopea 2019-05-09 11:16:01 +08:00
parent ffbd0513f9
commit 8a2f39ddcb

6
def.go
View File

@ -126,9 +126,9 @@ func fromChatWarsDate(d string) (t time.Time, err error) {
t, _ := time.Parse(time.RFC3339, "2018-01-31T00:00:00+00:00") t, _ := time.Parse(time.RFC3339, "2018-01-31T00:00:00+00:00")
t = t.AddDate(0, 0, (days / 3)) t = t.AddDate(0, 0, (days / 3))
t = t.Add(time.Hour * ((days % 3) * 8)) t = t.Add(time.Hour * time.Duration(days%3) * 8)
t = t.Add(time.Minute * (hour * 20)) t = t.Add(time.Minute * time.Duration(hour) * 20)
t = t.Add(time.Second * (minute * 20)) t = t.Add(time.Second * time.Duration(minute) * 20)
return t, nil return t, nil
} else { } else {
return time.Now(), errors.New("Wrong format") return time.Now(), errors.New("Wrong format")