CronExpression::getMultipleRunDates()publicWC 1.0

Get multiple run dates starting at the current date or a specific date

Method of the class: CronExpression{}

No Hooks.

Return

Array. Returns an array of run dates

Usage

$CronExpression = new CronExpression();
$CronExpression->getMultipleRunDates( $total, $currentTime, $invert, $allowCurrentDate );
$total(int) (required)
Set the total number of dates to calculate
$currentTime(string|DateTime)
(optional) Relative calculation date
Default: 'now'
$invert(true|false)
(optional) Set to TRUE to retrieve previous dates
Default: false
$allowCurrentDate(true|false)
(optional) Set to TRUE to return the
php current date if it matches the cron expression
Default: false

CronExpression::getMultipleRunDates() code WC 8.7.0

public function getMultipleRunDates($total, $currentTime = 'now', $invert = false, $allowCurrentDate = false)
{
    $matches = array();
    for ($i = 0; $i < max(0, $total); $i++) {
        $matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDate);
    }

    return $matches;
}