Quartz TimeZoneConverter 集成包
Quartz.Plugins.TimeZoneConverter 提供了与 TimeZoneConverter的集成,有助于弥合 *nix 和 Windows 之间的时间区域差异。
安装
你需要在使用 Quartz 的项目中添加 NuGet 包引用。
Install-Package Quartz.Plugins.TimeZoneConverter
使用
经典属性配置方式
var properties = new NameValueCollection {
["quartz.plugin.timeZoneConverter.type"] = "Quartz.Plugin.TimeZoneConverter.TimeZoneConverterPlugin, Quartz.Plugins.TimeZoneConverter"
};
ISchedulerFactory schedulerFactory = new StdSchedulerFactory(properties);
使用调度器构建器配置
var config = SchedulerBuilder.Create()
.UseTimeZoneConverter();
ISchedulerFactory schedulerFactory = config.Build();