Using cron-expression directly
<?php
require 'vendor/autoload.php';
use Cron\CronExpression;
$cron = new CronExpression('0 9 * * 1-5');
// Is the cron due right now?
if ($cron->isDue()) {
runJob();
}
// When does it fire next?
$next = $cron->getNextRunDate();
echo $next->format('Y-m-d H:i'); // e.g. "2026-04-27 09:00"
// Multi-step preview
foreach ($cron->getMultipleRunDates(5) as $date) {
echo $date->format('Y-m-d H:i') . "\n";
}