You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to reproduce #73 I noticed something else: Cronos stops working past the UTC time 31-12-2498 22:59:00.
Reproduction code:
CronExpressionexpression=CronExpression.Parse("* * * * *");varfromUtc=DateTime.SpecifyKind(newDateTime(2497,12,25),DateTimeKind.Utc);for(vari=0;i<1000000;i++){varresult=expression.GetNextOccurrence(fromUtc,TimeZoneInfo.Local);if(result==null){thrownewInvalidOperationException($"No result for input {fromUtc}");}fromUtc=result.Value;}
Exception is thrown with message No result for input 31-12-2498 22:59:00
Not sure if this is by design, I couldn't find anything for it.
I would have expected it to continue working up to DateTime.MaxValue. It seems like it works to about 1/4 of that.
The text was updated successfully, but these errors were encountered:
The year limit was introduced to avoid looping through 9999 year for unreachable cron expressions (as they can be more difficult than 30th of February). I have another idea to solve this problem though – to set a relative limitation, and not the absolute one. For example, we can limit the GetOccurrence method to stop iterations when nothing was found within the 100 years, starting from the from date. What do you think about this solution?
While trying to reproduce #73 I noticed something else: Cronos stops working past the UTC time 31-12-2498 22:59:00.
Reproduction code:
Exception is thrown with message
No result for input 31-12-2498 22:59:00
Not sure if this is by design, I couldn't find anything for it.
I would have expected it to continue working up to
DateTime.MaxValue
. It seems like it works to about 1/4 of that.The text was updated successfully, but these errors were encountered: