protected function getTimeout($xml)
    {
        $tz = date_default_timezone_get();
        date_default_timezone_set('UTC');

        $xml = @new \SimpleXMLElement($xml);
        $dt = (int) strtotime($xml->cachedUntil);
        $time = time();

        date_default_timezone_set($tz);

        return max(1, $dt - $time);
    }
protected function getTimeout($xml)
    {
        $tz = date_default_timezone_get();
        date_default_timezone_set('UTC');

        $xml = @new \SimpleXMLElement($xml);
        $dt = (int) strtotime($xml->cachedUntil);
        $time = time();

        date_default_timezone_set($tz);

        return max(1, $dt - $time);
    }
protected function getTimeout ( $ xml ) { $ tz = date_default_timezone_get ( ) ; date_default_timezone_set ( 'UTC' ) ; $ xml = @ new \ SimpleXMLElement ( $ xml ) ; $ dt = ( int ) strtotime ( $ xml -> cachedUntil ) ; $ time = time ( ) ; date_default_timezone_set ( $ tz ) ; return max ( 1 , $ dt - $ time ) ; }
Return the number of seconds the XML is valid. Will never be less than 1.

@param string $xml
@return int
Return the number of seconds the XML is valid . Will never be less than 1 .