dragonmantank / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
MIT License
4.57k stars 124 forks source link

Quarterly Cron Expression #116

Closed ericmg97 closed 2 years ago

ericmg97 commented 3 years ago

This cron expression must execute on 1st of January, April, July and October.

$cron = new CronExpression::factory('0 0 1 */3 *');

But it executes on 1st of March, June, September and December:

echo $cron->getNextRunDate()->format('Y-m-d H:i:s');

Output:

2021-09-01 00:00:00
tomme87 commented 3 years ago

I have the same issue with every 4th month (tertial) (ie. 30 2 2 1/4 *)

bilogic commented 3 years ago

@ericmg97 which version are you using? This seems to have been fixed years ago https://github.com/laravel/framework/issues/19532

dragonmantank commented 2 years ago

Yes, please let me know what version you are using. This was the actual original impetus for v2 (there were so many people who relied on the bad behavior it still exists in v1). Feel free to re-open if you are using v3.