src/Common/Internal/Validate.php
public static function isDateString($value, $name)
    {
        self::isString($value, 'value');

        try {
            new \DateTime($value);

            return true;
        } catch (\Exception $e) {
            throw new \InvalidArgumentException(
                sprintf(
                    Resources::ERROR_INVALID_DATE_STRING,
                    $name,
                    $value
                )
            );
        }
    }
public static function isDateString($value, $name)
    {
        self::isString($value, 'value');

        try {
            new \DateTime($value);

            return true;
        } catch (\Exception $e) {
            throw new \InvalidArgumentException(
                sprintf(
                    Resources::ERROR_INVALID_DATE_STRING,
                    $name,
                    $value
                )
            );
        }
    }
public static function isDateString ( $ value , $ name ) { self :: isString ( $ value , 'value' ) ; try { new \ DateTime ( $ value ) ; return true ; } catch ( \ Exception $ e ) { throw new \ InvalidArgumentException ( sprintf ( Resources :: ERROR_INVALID_DATE_STRING , $ name , $ value ) ) ; } }
Validate if string is date formatted.

@param string $value Value to validate
@param string $name  Name of parameter to insert in error message

@throws \InvalidArgumentException

@return bool
Validate if string is date formatted .