CronExpression::getPreviousRunDate()publicWC 1.0

Get a previous run date relative to the current date or a specific date

Method of the class: CronExpression{}

No Hooks.

Return

DateTime.

Usage

$CronExpression = new CronExpression();
$CronExpression->getPreviousRunDate( $currentTime, $nth, $allowCurrentDate );
$currentTime(string|DateTime)
(optional) Relative calculation date
Default: 'now'
$nth(int)
(optional) Number of matches to skip before returning
$allowCurrentDate(true|false)
(optional) Set to TRUE to return the
php current date if it matches the cron expression
Default: false

Notes

CronExpression::getPreviousRunDate() code WC 7.3.0

public function getPreviousRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
{
    return $this->getRunDate($currentTime, $nth, true, $allowCurrentDate);
}