fix
This commit is contained in:
@@ -26,12 +26,9 @@ func (cmd *SchedulePublishCommand) GetScheduledTime() (time.Time, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, format := range formats {
|
for _, format := range formats {
|
||||||
if t, err := time.Parse(format, cmd.ScheduledTime); err == nil {
|
if t, err := time.ParseInLocation(format, cmd.ScheduledTime, cst); err == nil {
|
||||||
// 如果解析的时间没有时区信息,则设置为中国东八区
|
// 确保返回的时间是东八区时区
|
||||||
if t.Location() == time.UTC {
|
return t.In(cst), nil
|
||||||
t = t.In(cst)
|
|
||||||
}
|
|
||||||
return t, nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user