quartz-scheduler / quartz

Code for Quartz Scheduler
http://www.quartz-scheduler.org
Apache License 2.0
6.16k stars 1.91k forks source link

Semantics of CalendarIntervalScheduleBuilder#preserveHourOfDayAcrossDaylightSavings #1136

Open TheCoder42 opened 3 weeks ago

TheCoder42 commented 3 weeks ago

Hello,

regarding CalendarIntervalScheduleBuilder#calendarIntervalSchedule. When I create a trigger like this:

val endOfMarch = LocalDateTime.of(2024, Month.MARCH, 31, 2, 30)
val schedule = CalendarIntervalScheduleBuilder.calendarIntervalSchedule().withIntervalInDays(1).preserveHourOfDayAcrossDaylightSavings(true)
TriggerBuilder
            .newTrigger()
            .forJob(scheduler.getJobDetail(JobKey.jobKey("myJob")))
            .startAt(Date.from(endOfMarch.atZone(ZoneId.systemDefault()).toInstant())
            .withSchedule(schedule)
            .build()

I assume that the time change will occur at 2 AM on 31st March (changing forward from 2 AM to 3 AM) and on 31st October at 3 AM (changing backward from to 3 AM to 2 AM).

As far as I understand the documentation it will be executed on March 31st (at 3:30 AM?). Will this trigger be executed once, twice or not at all on the October 31st? And if it is not executed at all on October 31: Can I create a trigger that is executed on every single day exactly once at 2:30 o'clock (accepting a different time at time-change-days)?

lprimak commented 1 week ago

This project is abandoned. See #1134