public static function isValidDateFormat($format)
    {
        if (empty($format) || !is_string($format)) {
            return false;
        }

        $formatted = (new DateTime())->format($format);

        // Formatted date it's the format who is validated?
        // The format is invalid
        if ($formatted === $format) {
            return false;
        }

        // Validate the format used to create the datetime
        $fromFormat = DateTime::createFromFormat($format, $formatted);

        // It's instance of DateTime?
        // The format is valid
        if ($fromFormat instanceof DateTime) {
            return true;
        }

        return $fromFormat instanceof DateTime;
    }