src/Leevel/Validate/Date.php
protected function makeDateTimeFormat(string $format, string $value)
    {
        $date = DateTime::createFromFormat($format, $value);

        if ($date) {
            return $date;
        }

        try {
            return new DateTime($value);
        } catch (Exception $e) {
        }
    }
protected function makeDateTimeFormat(string $format, string $value)
    {
        $date = DateTime::createFromFormat($format, $value);

        if ($date) {
            return $date;
        }

        try {
            return new DateTime($value);
        } catch (Exception $e) {
        }
    }
创建 DateTime 实例.

@param string $format
@param string $value

@return \DateTime|void