Cron Expression issue

Hi Everyone,

We are using the same cron expressions in both the pre and prod environments, but the task scheduler timings are different, even though both servers are in the same time zone. Has anyone else experienced this issue or have any suggestions?

1 Like

Share your cron expression being used.

1 Like

Hello Satish, thank you for your response.
We are currently using the following cron expression. Based on this, the task scheduler should trigger at 5:30 AM and 5:30 PM IST, but it is displaying incorrect timings in production. However, in pre-production, it appears as scheduled.

0 0 0/12 1/1 * ? *

Can you try this, looking at yours there is additional condition 1st of every month, though it shouldn’t cause issue its redundant for your case, try below and see if still behaving weird

0 0 0/12 ? * * *

We tried the given expression but the result is same

Hi Bhoyar, Can you please check below

if you want a cron expression that triggers at 5:30 AM and 5:30 PM local time (IST), and your scheduler runs in IST timezone, use:

0 30 5,17 * * ?

If your scheduler runs in UTC, use:

0 0 0,12 * * ?

Thank you, Naveen and Satish, for your responses.

The issue has been resolved by updating the TimeZone in the Apache Java options.

Here is the link for reference:
Solved: Time Zone issue from upgrading from 7.2P2 to 7.3 to 8.0 - Compass