WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

CronExpression::isDue() public WC 1.0

Determine if the cron is due to run based on the current date or a specific date. This method assumes that the current number of seconds are irrelevant, and should be called once per minute.

{} Это метод класса: CronExpression{}

Хуков нет.

Возвращает

true/false. Returns TRUE if the cron is due to run or FALSE if not

Использование

$CronExpression = new CronExpression();
$CronExpression->isDue( $currentTime );
$currentTime(строка/DateTime)
(optional) Relative calculation date
По умолчанию: 'now'

Код CronExpression::isDue() WC 4.6.1

<?php
public function isDue($currentTime = 'now')
{
    if ('now' === $currentTime) {
        $currentDate = date('Y-m-d H:i');
        $currentTime = strtotime($currentDate);
    } elseif ($currentTime instanceof DateTime) {
        $currentDate = $currentTime->format('Y-m-d H:i');
        $currentTime = strtotime($currentDate);
    } else {
        $currentTime = new DateTime($currentTime);
        $currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), 0);
        $currentDate = $currentTime->format('Y-m-d H:i');
        $currentTime = (int)($currentTime->getTimestamp());
    }

    return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime;
}