public function isDue($currentTime = null)
    {
        if (null === $currentTime || 'now' === $currentTime) {
            $currentDate = date('Y-m-d H:i:s');
            $currentTime = strtotime($currentDate);
        } elseif ($currentTime instanceof DateTime) {
            $currentDate = $currentTime->format('Y-m-d H:i:s');
            $currentTime = strtotime($currentDate);
        } else {
            $currentTime = new DateTime($currentTime);
            $currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), $currentTime->format('s'));
            $currentDate = $currentTime->format('Y-m-d H:i:s');
            $currentTime = $currentTime->getTimeStamp();
        }

        return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime;
    }
public function isDue($currentTime = null)
    {
        if (null === $currentTime || 'now' === $currentTime) {
            $currentDate = date('Y-m-d H:i:s');
            $currentTime = strtotime($currentDate);
        } elseif ($currentTime instanceof DateTime) {
            $currentDate = $currentTime->format('Y-m-d H:i:s');
            $currentTime = strtotime($currentDate);
        } else {
            $currentTime = new DateTime($currentTime);
            $currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), $currentTime->format('s'));
            $currentDate = $currentTime->format('Y-m-d H:i:s');
            $currentTime = $currentTime->getTimeStamp();
        }

        return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime;
    }
public function isDue ( $ currentTime = null ) { if ( null === $ currentTime || 'now' === $ currentTime ) { $ currentDate = date ( 'Y-m-d H:i:s' ) ; $ currentTime = strtotime ( $ currentDate ) ; } elseif ( $ currentTime instanceof DateTime ) { $ currentDate = $ currentTime -> format ( 'Y-m-d H:i:s' ) ; $ currentTime = strtotime ( $ currentDate ) ; } else { $ currentTime = new DateTime ( $ currentTime ) ; $ currentTime -> setTime ( $ currentTime -> format ( 'H' ) , $ currentTime -> format ( 'i' ) , $ currentTime -> format ( 's' ) ) ; $ currentDate = $ currentTime -> format ( 'Y-m-d H:i:s' ) ; $ currentTime = $ currentTime -> getTimeStamp ( ) ; } return $ this -> getNextRunDate ( $ currentDate , 0 , true ) -> getTimestamp ( ) == $ currentTime ; }
Deterime 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.

@param string|DateTime $currentTime (optional) Relative calculation date

@return bool Returns TRUE if the cron is due to run or FALSE if not
Deterime 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 .