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());
}