public static function dateSQL($date, $format = 'd-m-Y')
    {
        if (empty($date)) {
            return null;
        }

        $obj = DateTime::createFromFormat('Y-m-d H:i:s', $date);
        if (empty($obj)) {
            return null;
        }

        return $obj->format($format);
    }