So what you'd change this:
> DateTime startDate = DateTime.Parse(this.ComplexStartTime.Text);
to:
DateTime startDate =
DateTime.Parse(this.ComplexStartTime.Text).ToUniversalTime();
This has the assumption that you are running your server in the
desired time zone. This is a big hassle in .NET world compared to Java
world. .NET 3.5 has remedy for this but for Quartz.NET it's
unfortunately still a big leap to make.
-Marko
DateTime correctedTime = time.ToUniversalTime();//attempting to correct the time offset. time = correctedTime;
string minuteString = time.Minute.ToString(); string hourString = time.Hour.ToString(); string dayString = time.DayOfWeek.ToString("D"); string timeString = "0 " + minuteString + " " + hourString + " ? * " + dayString; //Second - Minute - Hour - DayOfMonth - Month - DayOfWeek - Year
ITrigger trigger = (ITrigger)TriggerBuilder.Create() .WithIdentity(triggerString, "group1") .WithCronSchedule(timeString) .ForJob(thisJobKey) .Build();
scheduler.ScheduleJob(thisJob, trigger);