解决localtion
This commit is contained in:
parent
05a5debf3c
commit
38c4267488
@ -35,8 +35,7 @@ func (c *Cron) SetContext(ctx context.Context) *Cron {
|
||||
func (c *Cron) SetTimeHHmm(HHmm string) *Cron {
|
||||
t, _ := time.Parse("15:04", HHmm)
|
||||
now := time.Now()
|
||||
l, _ := time.LoadLocation("Asia/Shanghai")
|
||||
c.time = time.Date(now.Year(), now.Month(), now.Day(), t.Hour(), t.Minute(), 0, 0, l)
|
||||
c.time = time.Date(now.Year(), now.Month(), now.Day(), t.Hour(), t.Minute(), 0, 0, now.Location())
|
||||
return c
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user