Just started using Zend_Validate_Date for date validation, and
ran into some weird issues. Seems like the validator returns false positive
for even obvious non-valid data.
Code:
$dateValidator = new Zend_Validate_Date();
$dateValidator->setFormat('yyyy-MM-dd HH:mm:ss');
$date = '0a-09-11 08:46:00';
if($dateValidator->isValid($date)) {
echo $date . " is a valid date.(!?)\n";
die();
}
Obviously this date is not of the required format, but the validator still accepts it as true.
Zend_Date::__construct also casually ignores the broken date part and just uses the correct time part. This might be intentional, while the validator definitely should not return true for a broken date string.