Use checkDateFormat($inputString, array('date_format' => $format,
$locale)) to check if a given string contains all expected date parts.
The checkDateFormat() method uses
getDate(), but without the option
'fixdate' to avoid returning TRUE when the
input fails to conform to the date format. If errors are detected in the input, such as
swapped values for months and days, the option 'fixdate' method
will apply heuristics to "correct" dates before determining their validity.
Example 568. Date testing
<?php
$locale = new Zend_Locale('de_AT');
// using the default date format for 'de_AT', is this a valid date?
if (Zend_Locale_Format::checkDateFormat('13.Apr.2006',
array('date_format' =>
Zend_Locale_Format::STANDARD,
$locale)
) {
print "date";
} else {
print "not a date";
}




