Quartz.net: FireAtTime doesn't seem to work as expected
NthIncludedDayTrigger
cause I want my trigger to fire every 5 months at a certain time. Here is the code:
NthIncludedDayTrigger trigger = new NthIncludedDayTrigger(triggerName, groupName);
trigger.Description = "My trigger";
trigger.StartTimeUtc = startDate;
trigger.EndTimeUtc = endD开发者_StackOverflow中文版ate;
trigger.IntervalType = NthIncludedDayTrigger.IntervalTypeMonthly;
trigger.N = 5;
trigger.FireAtTime = "09:00";
DateTime? Check = DateTime.Now;
DateTime? When = trigger.GetFireTimeAfter(Check.Value);
As you can see I want my trigger to run at 9AM (my timezone is GMT => Greenwich).
When I check (GetFireTimeAfter
) the next fire time I can see it is at 8AM.
I've checked the timezone trigger.TimeZone
and it is absolutely fine.
Is anyone here who can try to help? Thanks.
Just to be sure, you should use DateTime.UtcNow
instead of DateTime.Now
to get a DateTime
that has its Kind
set to UTC
.
精彩评论