Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduling tasks on London time while system time is NY

Our system is configured with US/Eastern time and we have some scheduled tasks which must occur at specific Europe/London times. How can we do this and make sure our tasks fire correctly when daylight time changes take effect?

We use Quartz for scheduling. Currently we schedule tasks using SimpleTrigger, and not CronTrigger. The docs indicate that CronTrigger should work - but I think this assumes the scheduled time and the system time are on the same time zone.

like image 561
Marcus Leon Avatar asked Dec 08 '25 22:12

Marcus Leon


1 Answers

CronTrigger would indeed serve your purpose better, as you can use its setTimeZone method to define which timezone will be used when resolving the trigger's CronExpression. And no, the scheduled time and system time do not need to be on the same timezone. So, it should certainly work. (Of course, pay attention to the notes about daylight savings and crontriggers in the documentation you linked to.)

like image 106
Tommi Avatar answered Dec 11 '25 11:12

Tommi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!