Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top