0

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?

sree1611
  • 352
  • 1
  • 4
  • 18

1 Answers1

0

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

Mar-Z
  • 2,660
  • 2
  • 4
  • 16
  • Even if I use "America/Montreal", it is not executing on FRIDAY when application is running on CET time zone – sree1611 Apr 25 '23 at 11:09
  • Well, it works as expected. Friday 23:55 in Montreal is Saturday 05:55 in Central Europe. You should use the same time zone for the CRON configuration and for the application. – Mar-Z Apr 25 '23 at 11:45