odata/library/ODataProducer/Providers/Metadata/Type/DateTime.php
/**
     * Validate a value in Astoria uri is in a format for this type
     * Note: implementation of IType::validate
     * 
     * @param string $value     The value to validate 
     * @param string &$outValue The stripped form of $value that can 
     *                          be used in PHP expressions
     * 
     * @return boolean
     */
Validate a value in Astoria uri is in a format for this type
Note: implementation of IType::validate

@param string $value     The value to validate
@param string &$outValue The stripped form of $value that can
be used in PHP expressions

@return boolean
Validate a value in Astoria uri is in a format for this type Note : implementation of IType :: validate @param string $value The value to validate @param string &$outValue The stripped form of $value that can be used in PHP expressions @return boolean
public function validate($value, &$outValue)
    {
        if (!preg_match("/^datetime\'(\d{4})-(\d{2})-(\d{2})((\s|T)([0-1][0-9]|2[0-4]):([0-5][0-9])(:([0-5][0-9])([Z])?)?)?\'$/", strval($value), $matches)
        ) {
            return false;
        } 
        $value = trim($value, 'datetime\'');
        if (!self::validateWithoutPreFix($value)) {
            return false;
        }
        $outValue = "'" . $value . "'";
        return true;
    }
public function validate ( $ value , & $ outValue ) { if ( ! preg_match ( " /^datetime\'(\d{4})-(\d{2})-(\d{2})((\s|T)([0-1][0-9]|2[0-4]):([0-5][0-9])(:([0-5][0-9])([Z])?)?)?\'$/ " , strval ( $ value ) , $ matches ) ) { return false ; } $ value = trim ( $ value , 'datetime\'' ) ; if ( ! self :: validateWithoutPreFix ( $ value ) ) { return false ; } $ outValue = " ' " . $ value . " ' " ; return true ; }
Validate a value in Astoria uri is in a format for this type
 Note: implementation of IType::validate
Validate a value in Astoria uri is in a format for this type Note : implementation of IType :: validate
//1. The datetime value present in the $filter option should have  //   'datetime' prefix. //2. Month and day should be two digit //stripoff prefix, and quotes from both ends //Validate the date using PHP DateTime class