public function fromSqlDate($sqlDate, Provider $provider = null)
    {
        if ($sqlDate === null) {
            return null;
        }

        $this->setParameterProvider($provider);
        // The "!" zeroes out the hours, minutes, and seconds
        $phpDate = DateTime::createFromFormat('!' . $provider->getDateFormat(), $sqlDate);

        if ($phpDate === false) {
            $phpDate = $this->parseUnknownDateTimeFormat($sqlDate);
        }

        return $phpDate;
    }
public function fromSqlDate($sqlDate, Provider $provider = null)
    {
        if ($sqlDate === null) {
            return null;
        }

        $this->setParameterProvider($provider);
        // The "!" zeroes out the hours, minutes, and seconds
        $phpDate = DateTime::createFromFormat('!' . $provider->getDateFormat(), $sqlDate);

        if ($phpDate === false) {
            $phpDate = $this->parseUnknownDateTimeFormat($sqlDate);
        }

        return $phpDate;
    }
public function fromSqlDate ( $ sqlDate , Provider $ provider = null ) { if ( $ sqlDate === null ) { return null ; } $ this -> setParameterProvider ( $ provider ) ; // The "!" zeroes out the hours, minutes, and seconds $ phpDate = DateTime :: createFromFormat ( '!' . $ provider -> getDateFormat ( ) , $ sqlDate ) ; if ( $ phpDate === false ) { $ phpDate = $ this -> parseUnknownDateTimeFormat ( $ sqlDate ) ; } return $ phpDate ; }
Converts an SQL date to a PHP date time

@param string $sqlDate The date to convert
@param Provider $provider The provider to convert from
@return DateTime|null The PHP date
@throws InvalidArgumentException Thrown if the input date couldn't be cast to a PHP date
Converts an SQL date to a PHP date time