I am using Quartz Scheduler and i need to make a scheduler which will execute specific job at every three months into the program. so how do i make that cronExpression so i can do this things in java? I need one month,Two month six month interval.

有帮助吗?

解决方案

This expression is tested and works perfectly for quartz 2.2

"0 0 0 1 1/3 ?" 

The above expression will fire every 3 months starting Jan 1st at 00:00 hours. Next will be on April 1st at 00:00 hrs.

for every 2 months use this

    "0 0 0 1 1/2 ?"

You can change the first three zeros as you like. They refer to the time on the 1st of the month. The next number ,ie, "1" in my case is the date.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top