如何安排后台作业在哥伦比亚时间每天晚上 9 点开始?我正在使用quartz.net
public class Program
{
static void Main(string[] args)
{
// construct a scheduler
var schedulerFactory = new StdSchedulerFactory();
var scheduler = schedulerFactory.GetScheduler();
scheduler.Start();
TimeZoneInfo colombianTimezone = TimeZoneInfo.FindSystemTimeZoneById("SA Pacific Standard Time");
var colombianTimeNow = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.Local,
colombianTimezone);
var job = JobBuilder.Create<EmailsJob>().Build();
var now = DateTime.Now;
var trigger = TriggerBuilder.Create()
.StartAt(//INeedThisToStartEverydayat9pmColombianTime)
.WithSimpleSchedule(x => x.WithIntervalInHours(24).RepeatForever())
.Build();
scheduler.ScheduleJob(job, trigger);
}
}
StartAt 方法采用 DateTimeOffset 对象。
请帮忙