-
Notifications
You must be signed in to change notification settings - Fork 264
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
nextExecution over daylight savings is wrong #61
Comments
@swanke00 Thank you for reporting this. Contributions are welcome! |
Adding to this issue. lastExecution() is also incorrect.
the output is Now = 2016-03-12T17:00:00.000-07:00, Note the UTC offset of -5:00 which is my local timezone offset and a time difference of 26 hours due to the incorrect zone offset. |
@swanke00 thank you! If you have some time, would you write a test case for this? Be well! |
cron-utils version 3.1.5 Here is a code snippet, you can run prints out the runtimes for this cron expression: * 0/2 * * * ? import com.cronutils.model.Cron; import org.joda.time.DateTime; public class BadDayLightSavings {
} |
@DanoOM Thank you! Wouldn't you mind to turn this example into a test case for this issue? I will be eager to accept such a pull request. |
I want to schedule something to run every day at 17:00. Cron tab is "0 17 * * *". When the nextExecution crosses daylight savings time, the hour is 18:00 (or 16:00 during fall back). Here's my code:
.. and the output is :
Last = 2016-03-12T17:00:00.000-05:00, Next Execution = 2016-03-13T18:00:00.000-04:00, diff = 24
Note: the next execution time is 18:00 instead of 17:00 and the time difference is 24 hours when it should be 23. When I run with November dates, the next execution hour is 16 and the diff is 24 hours instead of 25.
The text was updated successfully, but these errors were encountered: