问题
i need your help to learn Quartz.Net. But every sample is the same as each other. i want to startTime: 07.03.2012 13:28:10 but not working. Not return error code.how to start this time?
DateTime startdate = DateTime.Parse("07.03.2012 10:28:10", culture, System.Globalization.DateTimeStyles.AssumeLocal);
// DateTime startdate = Convert.ToDateTime("07.03.2012 09:46:10", culture);
//DateTime zaman = new DateTime(2012, 3,6,17, 12, 11);
DateTime parsedStartTime = DateTime.SpecifyKind(startdate, DateTimeKind.Utc);
DateTime localStartTime = parsedStartTime.ToLocalTime();
Trigger trigger = new SimpleTrigger("myFirstTrigger",
null,
parsedStartTime,
null,
5,
TimeSpan.FromSeconds(10));
回答1:
Quartz.Net expects that you pass in dates and times in UTC. Try changing this line:
parsedStartTime
to
parsedStartTime.ToUniversalTime())
or, make sure that parsedStartTime is in UTC before passing it in.
来源:https://stackoverflow.com/questions/9598601/how-to-start-a-job-any-time-in-quartz-net