Ways to deal with Daylight Savings time with Quartz Cron Trigger

Jon Bristow picture Jon Bristow · Mar 7, 2011 · Viewed 8.8k times · Source

I have a quartz cron trigger that looks like so:

<bean id="batchProcessCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
    <property name="jobDetail" ref="batchProcessJobDetail" />
    <property name="cronExpression" value="0 30 2 * * ?" />
</bean>

How should I solve this, if I have several configurations that happen within the 2-3am period? Is there an accepted best practice?

Relevant link: http://www.quartz-scheduler.org/docs/faq.html#FAQ-daylightSavings

Basically it says "Deal with it." But my question is how!

Answer

Jon Bristow picture Jon Bristow · Mar 10, 2011

I solved it using a separate trigger that only fires (an hour early) on the beginning date of DST for the configurations that happen between 2am and 3am Eastern.

Seems kludgey, but it works...