Java Scheduler Quartz Cron Trigger Time Setting

Vishu Singhvi picture Vishu Singhvi · Apr 13, 2012 · Viewed 8.6k times · Source

I am using Quartz for Scheduling my job in java. I have used "CronTrigger" for setting my time. I want to fire my Job each day at 11:55 Pm in night. What should i write in the setCronExpression(" ") for having my Job Done. .??

What i thought of the Code is:---

CronTrigger trigger = new CronTrigger();
trigger.setName("runMeJob");
trigger.setCronExpression("0 55 23 * * ?");

Is the above code correct or should i do some modifications in it????

Answer

JMelnik picture JMelnik · Apr 13, 2012

It would be: 0 55 23 1/1 * ? *

There is a nice website exactly for your case: CronMaker

CronMaker is a utility which helps you to build cron expressions. CronMaker uses Quartz open source scheduler. Generated expressions are based on Quartz cron format.