public function stringToDateTime(string $string) : \DateTime
    {
        $this->logger->notice("unsupported date format, use strtotime() to build the DateTime instance : {$string}");

        if (false === strtotime($string)) {
            throw new \InvalidArgumentException('Impossible to convert date : '.$string);
        }
        $date = new \DateTime($string, $this->getFeedTimezone());
        $date->setTimezone($this->getTimezone());

        return $date;
    }
public function stringToDateTime(string $string) : \DateTime
    {
        $this->logger->notice("unsupported date format, use strtotime() to build the DateTime instance : {$string}");

        if (false === strtotime($string)) {
            throw new \InvalidArgumentException('Impossible to convert date : '.$string);
        }
        $date = new \DateTime($string, $this->getFeedTimezone());
        $date->setTimezone($this->getTimezone());

        return $date;
    }
public function stringToDateTime ( string $ string ) : \ DateTime { $ this -> logger -> notice ( "unsupported date format, use strtotime() to build the DateTime instance : {$string}" ) ; if ( false === strtotime ( $ string ) ) { throw new \ InvalidArgumentException ( 'Impossible to convert date : ' . $ string ) ; } $ date = new \ DateTime ( $ string , $ this -> getFeedTimezone ( ) ) ; $ date -> setTimezone ( $ this -> getTimezone ( ) ) ; return $ date ; }
Creates a DateTime instance for the given string if the format was not catch from the list
@param  string                   $string
@return \DateTime
@throws InvalidArgumentException
Creates a DateTime instance for the given string if the format was not catch from the list