public static function mysqlToddmmyyyy($p_date, $p_withSeconds = false, $p_withHour = true)
    {
        if ($p_date !== null && $p_date != '') {
            $format1 = 'Y-m-d H:i:s';
            $format2 = 'Y-m-d';
            if ($p_withSeconds && $p_withHour) {
                $oFormat = 'd/m/Y H:i:s';
            } else {
                if ($p_withHour) {
                    $oFormat = 'd/m/Y H:i';
                } else {
                    $oFormat = 'd/m/Y';
                }
            }
            $date = \DateTime::createFromFormat($format1, $p_date);
            if ($date === false) {
                $date = \DateTime::createFromFormat($format2, $p_date);
            }
            if ($date !== false) {
                return $date->format($oFormat);
            }
        }
        return null;
    }