public function getHours()
    {
        if (array_key_exists('out', $this->attributes)) {
            if ($this->attributes['out']) {
                $hours = abs(round((strtotime($this->attributes['in']) - strtotime($this->attributes['out'])) / 3600, 2));

                return $hours;
            }
        }

        return;
    }
public function getHours()
    {
        if (array_key_exists('out', $this->attributes)) {
            if ($this->attributes['out']) {
                $hours = abs(round((strtotime($this->attributes['in']) - strtotime($this->attributes['out'])) / 3600, 2));

                return $hours;
            }
        }

        return;
    }
public function getHours ( ) { if ( array_key_exists ( 'out' , $ this -> attributes ) ) { if ( $ this -> attributes [ 'out' ] ) { $ hours = abs ( round ( ( strtotime ( $ this -> attributes [ 'in' ] ) - strtotime ( $ this -> attributes [ 'out' ] ) ) / 3600 , 2 ) ) ; return $ hours ; } } return ; }
Returns the number of hours a session lasted with decimals.

@return null|int
Returns the number of hours a session lasted with decimals .