CRUDlex\TwigExtensions::formatDateTime PHP Method

formatDateTime() public method

Formats the given value to a date of the format 'Y-m-d H:i'.
public formatDateTime ( string $value, boolean $isUTC ) : string
$value string the value, might be of the format 'Y-m-d H:i'
$isUTC boolean whether the given value is in UTC
return string the formatted result or an empty string on null value
    public function formatDateTime($value, $isUTC)
    {
        $timezone = $isUTC ? 'UTC' : date_default_timezone_get();
        return $this->formatTime($value, $timezone, 'Y-m-d H:i');
    }