。我想在下午 1.00、2.10、5.15 运行 Quartz 调度程序。这意味着小时+分钟。有人帮我解决这个问题的 Cron 表达式吗?
最佳答案
恐怕您无法完全按照您指定的方式进行操作。正如您在问题中提到的,here are一些资源可以帮助您克服这个问题(不完全符合您的要求)。但如果您可以将分钟时间更改为相同的数字,您就可以轻松实现这一目标。如果分钟数字非常重要,您必须运行 3 个触发器。这似乎是最简单的方法。 quartz中提到过.
Note that some scheduling requirements are too complicated to express with a single trigger - such as "every 5 minutes between 9:00 am and 10:00 am, and every 20 minutes between 1:00 pm and 10:00 pm". The solution in this scenario is to simply create two triggers, and register both of them to run the same job.
关于java - Cron 表达式在给定时间(小时和分钟)执行 cron 触发器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20186350/