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