Quartz Cron 表达式:每 15 天运行一次,即一个月内运行两次 [英] Quartz Cron expression :Run every 15 days ie twice in a month

查看:84
本文介绍了Quartz Cron 表达式:每 15 天运行一次,即一个月内运行两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一个石英 cron 表达式设置调度程序,它将每 15 天触发一次,例如每个月的 1 号和 15 号.0 15 10 15 * ?仅在每个月的 15 日触发月.

I want to set the scheduler with a quartz cron expression which will trigger every 15 days ,for example 1st and 15th of every month.The 0 15 10 15 * ? is triggering only on 15th of every month.

推荐答案

我已经测试过了,下面的表达式工作正常

I have tested this and the following expression works fine

        "0 0 0 1,15 * ?"

1,15 语句在每月 1 日和 15 日的 00:00 触发触发器.您可以更改前三个零以在您想要的特定时间触发它们.

the 1,15 statement fires triggers on 1st and 15th of every month at 00:00 hours. You can change the first three zeroes to fire them at a particular time you want.

第一个零 -> 秒

第二个零 -> 分钟

第三个零 -> 小时

这篇关于Quartz Cron 表达式:每 15 天运行一次,即一个月内运行两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆