src/Chippyash/Validation/Common/ISO8601/SplitDate.php
protected function getUTCTimezone()
    {
        if (\date_default_timezone_get() == 'UTC') {
            return 'UTC'; //already in UTC. workaround as zone must be non empty
        }
         
        $timezone = new \DateTimeZone(\date_default_timezone_get()); // Get default system timezone to create a new DateTimeZone object
        $offset = $timezone->getOffset(new \DateTime()); // Offset in seconds to UTC
        $offsetHours = round(abs($offset) / 3600);
        $offsetMinutes = round((abs($offset) - $offsetHours * 3600) / 60);
        $offsetString = ($offset < 0 ? '-' : '+')
            . ($offsetHours < 10 ? '0' : '') . $offsetHours
            . ($this->format == C::FORMAT_EXTENDED || $this->format == C::FORMAT_EXTENDED_SIGNED ? ':' : '')
            . ($offsetMinutes < 10 ? '0' : '') . $offsetMinutes;

        return $offsetString;
    }
protected function getUTCTimezone()
    {
        if (\date_default_timezone_get() == 'UTC') {
            return 'UTC'; //already in UTC. workaround as zone must be non empty
        }
         
        $timezone = new \DateTimeZone(\date_default_timezone_get()); // Get default system timezone to create a new DateTimeZone object
        $offset = $timezone->getOffset(new \DateTime()); // Offset in seconds to UTC
        $offsetHours = round(abs($offset) / 3600);
        $offsetMinutes = round((abs($offset) - $offsetHours * 3600) / 60);
        $offsetString = ($offset < 0 ? '-' : '+')
            . ($offsetHours < 10 ? '0' : '') . $offsetHours
            . ($this->format == C::FORMAT_EXTENDED || $this->format == C::FORMAT_EXTENDED_SIGNED ? ':' : '')
            . ($offsetMinutes < 10 ? '0' : '') . $offsetMinutes;

        return $offsetString;
    }
protected function getUTCTimezone ( ) { if ( \ date_default_timezone_get ( ) == 'UTC' ) { return 'UTC' ; //already in UTC. workaround as zone must be non empty } $ timezone = new \ DateTimeZone ( \ date_default_timezone_get ( ) ) ; // Get default system timezone to create a new DateTimeZone object $ offset = $ timezone -> getOffset ( new \ DateTime ( ) ) ; // Offset in seconds to UTC $ offsetHours = round ( abs ( $ offset ) / 3600 ) ; $ offsetMinutes = round ( ( abs ( $ offset ) - $ offsetHours * 3600 ) / 60 ) ; $ offsetString = ( $ offset < 0 ? '-' : '+' ) . ( $ offsetHours < 10 ? '0' : '' ) . $ offsetHours . ( $ this -> format == C :: FORMAT_EXTENDED || $ this -> format == C :: FORMAT_EXTENDED_SIGNED ? ':' : '' ) . ( $ offsetMinutes < 10 ? '0' : '' ) . $ offsetMinutes ; return $ offsetString ; }
Get current UTC timezone offset

@return string|null
Get current UTC timezone offset