Backend\Core\Engine\TemplateModifiers::formatDateTime PHP Method

formatDateTime() public static method

Format a UNIX-timestamp as a date syntax: {{ $var|formatdatetime }}
public static formatDateTime ( integer $var ) : string
$var integer The UNIX-timestamp to format.
return string
    public static function formatDateTime($var)
    {
        // get setting
        $format = Authentication::getUser()->getSetting('datetime_format');
        if ($var instanceof \DateTime) {
            $var = $var->getTimestamp();
        }
        // format the date
        return SpoonDate::getDate($format, (int) $var, BackendLanguage::getInterfaceLanguage());
    }