public function setTimeRange($from, $to)
    {
        $fromDate = date('Y-m-d H:i:s', (int) $from);
        $toDate = date('Y-m-d H:i:s', (int) $to);

        $this->where(array("time > '$fromDate'", "time < '$toDate'"));

        return $this;
    }
public function setTimeRange($from, $to)
    {
        $fromDate = date('Y-m-d H:i:s', (int) $from);
        $toDate = date('Y-m-d H:i:s', (int) $to);

        $this->where(array("time > '$fromDate'", "time < '$toDate'"));

        return $this;
    }
public function setTimeRange ( $ from , $ to ) { $ fromDate = date ( 'Y-m-d H:i:s' , ( int ) $ from ) ; $ toDate = date ( 'Y-m-d H:i:s' , ( int ) $ to ) ; $ this -> where ( array ( "time > '$fromDate'" , "time < '$toDate'" ) ) ; return $ this ; }
Set's the time range to select data from

@param  int $from
@param  int $to
@return $this
Set s the time range to select data from