Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Asia/Kolkata(+0530) timezone cause schedule inaccuracy #55

Closed
Jack-Ji opened this issue Apr 1, 2016 · 1 comment
Closed

Using Asia/Kolkata(+0530) timezone cause schedule inaccuracy #55

Jack-Ji opened this issue Apr 1, 2016 · 1 comment

Comments

@Jack-Ji
Copy link

Jack-Ji commented Apr 1, 2016

Example Code:

func main() {
    schedule, _ := cron.Parse("0 0 12 * * ?")
    fmt.Printf("%s\n", time.Now())
    fmt.Printf("%s\n", schedule.Next(time.Now()))
}

Output:
2016-04-01 11:09:16.342426894 +0530 IST
2016-04-02 12:00:00 +0530 IST

After examination of spec.go, I think the problem was caused by usage of
time.Truncate in SpecSchedule's method Next, which should use time.Date
instead to round up hours/minutes/seconds.

Any other ideas?

@robfig
Copy link
Owner

robfig commented Aug 9, 2016

I believe this has since been fixed. Please feel free to reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants