public function checkEffectiveTime()
    {
        sscanf( $this->effectiveTime, "%2d%2d-%2d%2d",
                $start_hour, $start_min,
                $end_hour, $end_min
        );

        $startTime  = strtotime(date("Y-m-d ").$start_hour.":".$start_min) ? strtotime(date("Y-m-d ").$start_hour.":".$start_min) : strtotime(date("Y-m-d 00:00"));
        $endTime    = strtotime(date("Y-m-d ").$end_hour.":".$end_min) ? strtotime(date("Y-m-d ").$end_hour.":".$end_min) : strtotime(date("Y-m-d 23:59:59"));

        $nowTime    = time();

        if($startTime>0 && $endTime>0)
        {
            //auto convert start time and end time
            if($endTime < $startTime)
            {
                $tmpTime = $startTime;
                $startTime = $endTime;
                $endTime = $tmpTime;
            }

            if($startTime < $nowTime && $nowTime < $endTime )
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
public function checkEffectiveTime()
    {
        sscanf( $this->effectiveTime, "%2d%2d-%2d%2d",
                $start_hour, $start_min,
                $end_hour, $end_min
        );

        $startTime  = strtotime(date("Y-m-d ").$start_hour.":".$start_min) ? strtotime(date("Y-m-d ").$start_hour.":".$start_min) : strtotime(date("Y-m-d 00:00"));
        $endTime    = strtotime(date("Y-m-d ").$end_hour.":".$end_min) ? strtotime(date("Y-m-d ").$end_hour.":".$end_min) : strtotime(date("Y-m-d 23:59:59"));

        $nowTime    = time();

        if($startTime>0 && $endTime>0)
        {
            //auto convert start time and end time
            if($endTime < $startTime)
            {
                $tmpTime = $startTime;
                $startTime = $endTime;
                $endTime = $tmpTime;
            }

            if($startTime < $nowTime && $nowTime < $endTime )
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
public function checkEffectiveTime ( ) { sscanf ( $ this -> effectiveTime , "%2d%2d-%2d%2d" , $ start_hour , $ start_min , $ end_hour , $ end_min ) ; $ startTime = strtotime ( date ( "Y-m-d " ) . $ start_hour . ":" . $ start_min ) ? strtotime ( date ( "Y-m-d " ) . $ start_hour . ":" . $ start_min ) : strtotime ( date ( "Y-m-d 00:00" ) ) ; $ endTime = strtotime ( date ( "Y-m-d " ) . $ end_hour . ":" . $ end_min ) ? strtotime ( date ( "Y-m-d " ) . $ end_hour . ":" . $ end_min ) : strtotime ( date ( "Y-m-d 23:59:59" ) ) ; $ nowTime = time ( ) ; if ( $ startTime > 0 && $ endTime > 0 ) { //auto convert start time and end time if ( $ endTime < $ startTime ) { $ tmpTime = $ startTime ; $ startTime = $ endTime ; $ endTime = $ tmpTime ; } if ( $ startTime < $ nowTime && $ nowTime < $ endTime ) { return true ; } else { return false ; } } }
Check Effective Time

@return boolean
Check Effective Time