protected function formatDatetime(DateTimeInterface $date, PropDefinition $definition): string
    {
        $timezone = $definition->get('timezone', $this->getDefaultTimezone());
        if ($timezone !== null) {
            $date = $this->convertTimeZone($date, $timezone);
        }

        return $date->format($definition->get('format', $this->getDatetimeFormat()));
    }
protected function formatDatetime(DateTimeInterface $date, PropDefinition $definition): string
    {
        $timezone = $definition->get('timezone', $this->getDefaultTimezone());
        if ($timezone !== null) {
            $date = $this->convertTimeZone($date, $timezone);
        }

        return $date->format($definition->get('format', $this->getDatetimeFormat()));
    }
protected function formatDatetime ( DateTimeInterface $ date , PropDefinition $ definition ) : string { $ timezone = $ definition -> get ( 'timezone' , $ this -> getDefaultTimezone ( ) ) ; if ( $ timezone !== null ) { $ date = $ this -> convertTimeZone ( $ date , $ timezone ) ; } return $ date -> format ( $ definition -> get ( 'format' , $ this -> getDatetimeFormat ( ) ) ) ; }
Format a date object.

@param DateTimeInterface $date
@param PropDefinition    $definition

@return string
Format a date object .