A trouble in CronExpression

2 views
Skip to first unread message

Grafit

unread,
Jul 19, 2007, 7:44:22 AM7/19/07
to Quartz.NET
CronExpression seems to have some faulty code - it doesn't handle hour
shift properly.
In GetTimeAfter, line 1358 (or smth. near)
we have code

min++;
d = new DateTime(d.Year, d.Month, d.Day, d.Hour, min, d.Second,
d.Millisecond);

that raises exceptions when minute was 59 - it merely gets erratically
equal to 60.
Replaced it with

d = d.AddMinutes(1);
and it works, but I'm a little nervous since I may have broken some
deep ideas :)).

The error occured when I made a CronTrigger launch every 5 seconds and
excluded the current day using AnnualCalendar - when GetTimeAfter is
supplied a date like (xx : 59 : 55) it fails.

Marko Lahma

unread,
Jul 23, 2007, 8:11:30 AM7/23/07
to quar...@googlegroups.com
Reproduced and fixed. Now in trunk and will be part of the next release.

Thanks,

-Marko

Reply all
Reply to author
Forward
0 new messages