public function isItTimeYet()
    {
        $now = $this->DateFactory->newLocalDate();
        $today = strtolower($now->format("D"));

        $days = $this->getParameter('days');           //sun,mon,tue,wed,thu,fri,sat
        $date = $this->getParameter('date');           //Y-m-d
        $startTime = $this->getParameter('startTime'); //H:i:s
        $endTime = $this->getParameter('endTime');     //H:i:s or +3 hours

        if($days != null && !in_array($today,explode(',',strtolower($days)))) {
            return false;
        }

        if($date != null && $now->format('Y-m-d') != $date) {
            return false;
        }

        if($startTime != null) {

            if($now < $this->DateFactory->newLocalDate($now->format('Y-m-d').' '.$startTime)) {
                return false;
            }

            if($endTime != null) {

                if(substr($endTime,0,1) == '+')
                    $endTime = $startTime.' '.$endTime;

                if($now > $this->DateFactory->newLocalDate($now->format('Y-m-d').' '.$endTime)) {
                    return false;
                }
            }
        }

        return true;
    }
public function isItTimeYet()
    {
        $now = $this->DateFactory->newLocalDate();
        $today = strtolower($now->format("D"));

        $days = $this->getParameter('days');           //sun,mon,tue,wed,thu,fri,sat
        $date = $this->getParameter('date');           //Y-m-d
        $startTime = $this->getParameter('startTime'); //H:i:s
        $endTime = $this->getParameter('endTime');     //H:i:s or +3 hours

        if($days != null && !in_array($today,explode(',',strtolower($days)))) {
            return false;
        }

        if($date != null && $now->format('Y-m-d') != $date) {
            return false;
        }

        if($startTime != null) {

            if($now < $this->DateFactory->newLocalDate($now->format('Y-m-d').' '.$startTime)) {
                return false;
            }

            if($endTime != null) {

                if(substr($endTime,0,1) == '+')
                    $endTime = $startTime.' '.$endTime;

                if($now > $this->DateFactory->newLocalDate($now->format('Y-m-d').' '.$endTime)) {
                    return false;
                }
            }
        }

        return true;
    }
public function isItTimeYet ( ) { $ now = $ this -> DateFactory -> newLocalDate ( ) ; $ today = strtolower ( $ now -> format ( "D" ) ) ; $ days = $ this -> getParameter ( 'days' ) ; //sun,mon,tue,wed,thu,fri,sat $ date = $ this -> getParameter ( 'date' ) ; //Y-m-d $ startTime = $ this -> getParameter ( 'startTime' ) ; //H:i:s $ endTime = $ this -> getParameter ( 'endTime' ) ; //H:i:s or +3 hours if ( $ days != null && ! in_array ( $ today , explode ( ',' , strtolower ( $ days ) ) ) ) { return false ; } if ( $ date != null && $ now -> format ( 'Y-m-d' ) != $ date ) { return false ; } if ( $ startTime != null ) { if ( $ now < $ this -> DateFactory -> newLocalDate ( $ now -> format ( 'Y-m-d' ) . ' ' . $ startTime ) ) { return false ; } if ( $ endTime != null ) { if ( substr ( $ endTime , 0 , 1 ) == '+' ) $ endTime = $ startTime . ' ' . $ endTime ; if ( $ now > $ this -> DateFactory -> newLocalDate ( $ now -> format ( 'Y-m-d' ) . ' ' . $ endTime ) ) { return false ; } } } return true ; }
Returns true if now is within the specified date criteria; false otherwise.
The server timezone is used for all dates.

Expected Params:
days      string A comma-separated list of lowercase 3-character day abbreviations; today must match at least one of these days; optional
date      string A string in the format of Y-m-d; today must match this date; optional
startTime string A string in the format of H:i:s; now must be equal to or after this time; optional
endTime   string A string in the format of H:i:s or '+X unit' (i.e. +3 hours); now must be before this time; optional

@return boolean
Returns true if now is within the specified date criteria ; false otherwise . The server timezone is used for all dates .