src/DateTime.php
public function format($format = null)
    {
        if (empty($format)) {
            $format = $this->defaultFormat;
        }
        return $this->formatDatetimeObject($format);
    }
public function format($format = null)
    {
        if (empty($format)) {
            $format = $this->defaultFormat;
        }
        return $this->formatDatetimeObject($format);
    }
public function format ( $ format = null ) { if ( empty ( $ format ) ) { $ format = $ this -> defaultFormat ; } return $ this -> formatDatetimeObject ( $ format ) ; }
Returns formatting date.

@param string|null $format http://php.net/date format or format name. Default value is current
@return string
Returns formatting date .