src/ICal/ICal.php
public function calendarTimeZone($ignoreUtc = false)
    {
        if (isset($this->cal['VCALENDAR']['X-WR-TIMEZONE'])) {
            $timeZone = $this->cal['VCALENDAR']['X-WR-TIMEZONE'];
        } elseif (isset($this->cal['VTIMEZONE']['TZID'])) {
            $timeZone = $this->cal['VTIMEZONE']['TZID'];
        } else {
            $timeZone = $this->defaultTimeZone;
        }

        // Use default time zone if the calendar's is invalid
        if ($this->isValidIanaTimeZoneId($timeZone) === false) {
            // phpcs:ignore CustomPHPCS.ControlStructures.AssignmentInCondition.Warning
            if (($timeZone = $this->isValidCldrTimeZoneId($timeZone, true)) === false) {
                $timeZone = $this->defaultTimeZone;
            }
        }

        if ($ignoreUtc && strtoupper($timeZone) === self::TIME_ZONE_UTC) {
            return null;
        }

        return $timeZone;
    }
public function calendarTimeZone($ignoreUtc = false)
    {
        if (isset($this->cal['VCALENDAR']['X-WR-TIMEZONE'])) {
            $timeZone = $this->cal['VCALENDAR']['X-WR-TIMEZONE'];
        } elseif (isset($this->cal['VTIMEZONE']['TZID'])) {
            $timeZone = $this->cal['VTIMEZONE']['TZID'];
        } else {
            $timeZone = $this->defaultTimeZone;
        }

        // Use default time zone if the calendar's is invalid
        if ($this->isValidIanaTimeZoneId($timeZone) === false) {
            // phpcs:ignore CustomPHPCS.ControlStructures.AssignmentInCondition.Warning
            if (($timeZone = $this->isValidCldrTimeZoneId($timeZone, true)) === false) {
                $timeZone = $this->defaultTimeZone;
            }
        }

        if ($ignoreUtc && strtoupper($timeZone) === self::TIME_ZONE_UTC) {
            return null;
        }

        return $timeZone;
    }
public function calendarTimeZone ( $ ignoreUtc = false ) { if ( isset ( $ this -> cal [ 'VCALENDAR' ] [ 'X-WR-TIMEZONE' ] ) ) { $ timeZone = $ this -> cal [ 'VCALENDAR' ] [ 'X-WR-TIMEZONE' ] ; } elseif ( isset ( $ this -> cal [ 'VTIMEZONE' ] [ 'TZID' ] ) ) { $ timeZone = $ this -> cal [ 'VTIMEZONE' ] [ 'TZID' ] ; } else { $ timeZone = $ this -> defaultTimeZone ; } // Use default time zone if the calendar's is invalid if ( $ this -> isValidIanaTimeZoneId ( $ timeZone ) === false ) { // phpcs:ignore CustomPHPCS.ControlStructures.AssignmentInCondition.Warning if ( ( $ timeZone = $ this -> isValidCldrTimeZoneId ( $ timeZone , true ) ) === false ) { $ timeZone = $ this -> defaultTimeZone ; } } if ( $ ignoreUtc && strtoupper ( $ timeZone ) === self :: TIME_ZONE_UTC ) { return null ; } return $ timeZone ; }
Returns the calendar time zone

@param  boolean $ignoreUtc
@return string
Returns the calendar time zone