Get next fire time only by looking at cron expression

我们两清 提交于 2019-12-12 17:38:12

问题


I am running Quartz.NET as a service and I add my jobs directly in the quartz-jobs.xml file. So in order to add and delete jobs and triggers I deal with Xml and not the normal functions. I would like to know how can we get the next fire time of a trigger just by looking at its cron expression?


回答1:


You can get the next fire time from given cron expression:

var expression = new CronExpression("0 26 13 17 10 ? 2015");
DateTimeOffset? time = expression.GetTimeAfter(DateTimeOffset.UtcNow);


来源:https://stackoverflow.com/questions/26400648/get-next-fire-time-only-by-looking-at-cron-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!