Cake\Localized\Validation\DeValidation::dob PHP Method

dob() public static method

Checks date of birth formal format for Germany (dd.mm.yyyy), afterwards checks it is a valid gregorian calendar date.
public static dob ( string $check ) : boolean
$check string the date of birth.
return boolean Success.
    public static function dob($check)
    {
        $pattern = '/^\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})$/';
        $return = preg_match($pattern, $check);
        if (!$return) {
            return false;
        }
        $check = str_replace('.', ',', $check);
        $check = explode(',', $check, 3);
        return checkdate((int) $check[1], (int) $check[0], (int) $check[2]);
    }