From the Quartz Scheduler javadocs for the method setTimeZone of class CronTrigger:
If setCronExpression(CronExpression) is called after this method, the TimeZone setting on the CronExpression will “win”. However if setCronExpression(String) is called
after this method, the time zone applied by this method will remain in
effect, since the String cron expression does not carry a time zone!
What’s the difference in calling both setters in different sequences?
There are three scenarios-
You call setTimeZone() followed by setCronExpression(CronExpression). The time zone associated with the CronExpression will apply.
You call setTimeZone() followed by setCronExpression(String). The time zone specified by setTimeZone() will apply since the String cron expression doesn’t have a time zone associated.
You call setCronExpression(CronExpression) or setCronExpression(String) followed by setTimeZone(). The time zone specified by setTimeZone() method will apply.