public static function date($value, $format, $message = null, $propertyPath = null)
{
static::string($value, $message, $propertyPath);
static::string($format, $message, $propertyPath);
$dateTime = \DateTime::createFromFormat($format, $value);
if (false === $dateTime || $value !== $dateTime->format($format)) {
$message = sprintf($message ?: 'Date "%s" is invalid or does not match format "%s".', static::stringify($value), static::stringify($format));
throw static::createException($value, $message, static::INVALID_DATE, $propertyPath, array('format' => $format));
}
return true;
}