CronManager jobs changing time after daylight saving time change

In MODx v3.1.2 I have CronManager 1.4.0 installed and a CronJob setup to run, for example, a job at 3:00pm.

After the recent daylight saving time change the CronJob itself changed from 3:00pm to 4:00pm.

Is that normal behavior?

4:00pm (Spring forward) is technically the older 3:00pm regular time, but seems like not a behavior most people would want.

How exactly did you set this up? Does the cronjob call the file cron.php every minute?
I believe the way CronManager works, is that you can only set an interval and not a specific time. What’s your interval? 1’440 minutes?

1 Like

The interval is 1440 minutes.

If the interval is the master control, then the shift would make sense. The human readable time is just calculated from that.

CronManager lets you set a specific time for the start, but then all other times afterward must be just chain reaction interval calculations.

If you have only one snippet that you want to run with the CronManager extra, you could set a specific time for the cronjob on the server (instead of running it every minute). When you then set a smaller interval in CronManager, so that the snippet is executed every time the cronjob runs, I guess you could avoid the issue with the daylight saving time.

1 Like

The calculating of the next run is created here:

It can be changed to

$cronjob->set('nextrun', date('Y-m-d H:i:s', strtotime('+' . $cronjob->get('minutes') . ' minutes', (strtotime($rundatetime)))));

Then it will use an interval considering daylight savings. I will add this as an configurable option in the next version.

1 Like