public function formatTime($time)
    {
        if ($this->timeFormat === null || $this->timeFormat === false) {
            return $time;
        }

        $dateTime = new \DateTime($time);

        if ($this->timeFormat === true) {
            return $dateTime;
        }

        return $dateTime->format($this->timeFormat);
    }
public function formatTime($time)
    {
        if ($this->timeFormat === null || $this->timeFormat === false) {
            return $time;
        }

        $dateTime = new \DateTime($time);

        if ($this->timeFormat === true) {
            return $dateTime;
        }

        return $dateTime->format($this->timeFormat);
    }
public function formatTime ( $ time ) { if ( $ this -> timeFormat === null || $ this -> timeFormat === false ) { return $ time ; } $ dateTime = new \ DateTime ( $ time ) ; if ( $ this -> timeFormat === true ) { return $ dateTime ; } return $ dateTime -> format ( $ this -> timeFormat ) ; }
Converts time to previously set format.

@param string $time

@return \DateTime|string
Converts time to previously set format .