Scheduler timezone issue with Daylight Savings Time

Description

When a CommandBox site is running ColdBox scheduled tasks, if there is a change for daylight savings, the scheduled task is then an hour off from when it is supposed to run.

Restarting the site seems to fix the issue until the next daylight savings change.

From Jon Clausen commenting on why a restart fixes it:

I’m sure it’s getting the current offset when the site restarts and the task is registered again. Because the java ZoneId becomes a singleton object in the task, the offset probably never changes in the life of a registered task. The solution would be to construct a new ZoneID instance using the timezone string on every check of the task run.

Activity

Show:
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Priority

Sentry

Created November 6, 2024 at 8:22 PM
Updated November 6, 2024 at 8:22 PM