-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate all run dates between two dates #1
Comments
Not pretty or very good but this works: <?php
$start = "2010-01-12 00:00:00";
$end = "2011-01-13 00:00:00";
$ahead = 0;
$cron = Cron\CronExpression::factory('@monthly');
$init = $cron->getNextRunDate($start, $ahead)->format('Y-m-d H:i:s');
while (strtotime($init) <= strtotime($end)) {
echo "<pre>$init\n<pre>";
$ahead++;
$init = $cron->getNextRunDate($start, $ahead)->format('Y-m-d H:i:s');
}
?> |
Same for "get next X runs" or is that possible already? |
Needed a from-to last days ... EDIT: i just realizeed that the param
I used Suggestions: One single method to get datetime input to datetime objectThere are atm 3 places of
New method to get multiple run dates by timeframeImplement a metod
and use the new|suggested
The code for this method would be ofc the one in the concept above, without the need of the cron expression model creation. |
I think this could be great to have this feature implemented =)
The text was updated successfully, but these errors were encountered: