public function formatTime($column, $format = self::DATETIME)
    {
        //if the column isn't set
        if (!isset($this->data[$column])) {
            //do nothing more
            return $this;
        }

        if (is_numeric($this->data[$column])) {
            $this->data[$column] = (int) $this->data[$column];
        }

        //if this is column is a string
        if (is_string($this->data[$column])) {
            //make into time
            $this->data[$column] = strtotime($this->data[$column]);
        }

        //if this column is not an integer
        if (!is_int($this->data[$column])) {
            //do nothing more
            return $this;
        }

        //set it
        $this->data[$column] = date($format, $this->data[$column]);

        return $this;
    }
public function formatTime($column, $format = self::DATETIME)
    {
        //if the column isn't set
        if (!isset($this->data[$column])) {
            //do nothing more
            return $this;
        }

        if (is_numeric($this->data[$column])) {
            $this->data[$column] = (int) $this->data[$column];
        }

        //if this is column is a string
        if (is_string($this->data[$column])) {
            //make into time
            $this->data[$column] = strtotime($this->data[$column]);
        }

        //if this column is not an integer
        if (!is_int($this->data[$column])) {
            //do nothing more
            return $this;
        }

        //set it
        $this->data[$column] = date($format, $this->data[$column]);

        return $this;
    }
public function formatTime ( $ column , $ format = self :: DATETIME ) { //if the column isn't set if ( ! isset ( $ this -> data [ $ column ] ) ) { //do nothing more return $ this ; } if ( is_numeric ( $ this -> data [ $ column ] ) ) { $ this -> data [ $ column ] = ( int ) $ this -> data [ $ column ] ; } //if this is column is a string if ( is_string ( $ this -> data [ $ column ] ) ) { //make into time $ this -> data [ $ column ] = strtotime ( $ this -> data [ $ column ] ) ; } //if this column is not an integer if ( ! is_int ( $ this -> data [ $ column ] ) ) { //do nothing more return $ this ; } //set it $ this -> data [ $ column ] = date ( $ format , $ this -> data [ $ column ] ) ; return $ this ; }
Useful method for formating a time column.

@param *string $column Column name
@param string  $format datetime format

@return Model
Useful method for formating a time column .