public static function mysqlToDatetime($p_date)
    {
        $date = new \Datetime();
        if ($p_date !== null && $p_date != '') {
            $format = 'Y-m-d H:i:s';
            $date = \DateTime::createFromFormat($format, $p_date);
            if ($date === false) {
                $date = new \Datetime();
            }
        }
        return $date;
    }