Cronos icon indicating copy to clipboard operation
Cronos copied to clipboard

Does not accept cron expression

Open qudooschaudhry opened this issue 4 years ago • 3 comments

Is this not a valid cron expression?

0 0 11 * 7 SAT

Cronos fails with : 'Unexpected character 'S'.'

qudooschaudhry avatar Jul 17 '21 14:07 qudooschaudhry

doesn't take this either

0 0 11 * 7 6

qudooschaudhry avatar Jul 17 '21 14:07 qudooschaudhry

Please specify CronFormat.IncludeSeconds in the constructor, otherwise it's unclear in general case whether 6th part is about seconds or about years.

var expression = CronExpression.Parse("0 0 11 * 7 SAT", CronFormat.IncludeSeconds);
Console.WriteLine(expression.GetNextOccurrence(DateTime.UtcNow));

odinserj avatar Jul 19 '21 12:07 odinserj

Thank you that was it.

qudooschaudhry avatar Jul 19 '21 19:07 qudooschaudhry