public function convertToDate($value) {

		foreach($this -> date_formats as $format) {

			if(false !== \DateTime :: createFromFormat($format, $value)) {

				$d = new DateTime($value);
				$d -> createFromFormat($format, $value);

				if($d && $d -> format($format) == $value) {

					$d -> saveFormat($format);
					return $d;
				}
			}
		}

		return $value;
	}
public function convertToDate($value) {

		foreach($this -> date_formats as $format) {

			if(false !== \DateTime :: createFromFormat($format, $value)) {

				$d = new DateTime($value);
				$d -> createFromFormat($format, $value);

				if($d && $d -> format($format) == $value) {

					$d -> saveFormat($format);
					return $d;
				}
			}
		}

		return $value;
	}
public function convertToDate ( $ value ) { foreach ( $ this -> date_formats as $ format ) { if ( false !== \ DateTime :: createFromFormat ( $ format , $ value ) ) { $ d = new DateTime ( $ value ) ; $ d -> createFromFormat ( $ format , $ value ) ; if ( $ d && $ d -> format ( $ format ) == $ value ) { $ d -> saveFormat ( $ format ) ; return $ d ; } } } return $ value ; }
Tries to check if given value is a valid date. If so, return the used format and returns a sFire DateTime object. Otherwise, returns the given value
@param string $value
@return mixed
Tries to check if given value is a valid date . If so return the used format and returns a sFire DateTime object . Otherwise returns the given value