mtdowling / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
http://mtdowling.com/blog/2012/06/03/cron-expressions-in-php/
MIT License
4.9k stars 335 forks source link

Invalid getNextRunDate() #7

Closed danut007ro closed 12 years ago

danut007ro commented 12 years ago

Hello, I use your code like this :

// create cron expression
$cronEx = CronExpression::factory('* * * * *');
// create last and next run time
$current_date = new DateTime('2011-09-27 10:10:54');
$next_run = $cronEx->getNextRunDate($current_date);

But when this gets executed, $next_run is '2011-09-27 10:10:00' which is wrong, it should actually be '2011-09-27 10:11:00'.

Thank you for this fine class