SPRING Cron expression is not working on FRIDAY

51 views Asked by At

I have to create the batch job which will run based on the time zone.

CronTrigger cronTrigger = new CronTrigger("0 55 23 ? * MON-FRI", TimeZone.getTimeZone("America/Toronto"));
taskRegistrar.addTriggerTask(() -> lunchJob(job), cronTrigger); 

The above program is running on CET time zone This is working as expected from Monday to Thursday, not executing on FRIDAY.

Is it some wrong?

1

There are 1 answers

2
Mar-Z On

"America/Toronto" is not a valid (Java) time zone. For the Canada Eastern Standard Time use "America/Montreal".