gpt4 book ai didi

c# - Quartz.net 为 ITrigger 设置时区?

转载 作者:行者123 更新时间:2023-12-03 02:44:52 26 4
gpt4 key购买 nike

ITrigger cronTrigger = TriggerBuilder.Create()
.WithIdentity("trigger1", "group1")
.WithCronSchedule(0 0/1 * 1/1 * ? *)
.Build();

此代码将运行时间设置为比我希望的早一小时,因此不是在 1:40 运行,而是在 12:40 运行。我可以将 Itrigger 的时区设置为英国时间吗?

最佳答案

ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("trigger3", "group1")
.WithCronSchedule(
"Your CRON Expression comes here",
x => x.InTimeZone(TimeZoneInfo.FindSystemTimeZoneById("Your Time Zone Id comes here"))
)
.ForJob("GUID / any unique combination ID comes here ")
.Build()

关于c# - Quartz.net 为 ITrigger 设置时区?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17970691/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com