Tells whether two DateTimeZone are equal by comparing their names

@param  ValueObjectInterface $timezone
@return bool
171616
public function sameValueAs(ValueObjectInterface $timezone)
    {
        if (false === Util::classEquals($this, $timezone)) {
            return false;
        }

        return $this->getName()->sameValueAs($timezone->getName());
    }
659802
public function equalsTo(Object $object)
    {
        if (!$this->sameTypeAs($object)) {
            throw new NotMatchTypeException($this);
        }

        return
            $this->year() === $object->year() &&
            $this->month() === $object->month() &&
            $this->day() === $object->day() &&
            $this->hour() === $object->hour() &&
            $this->minute() === $object->minute() &&
            $this->second() === $object->second();
    }
1060998
public function Equals( $obj )
	{
		if ( ! $obj instanceof GMonthValue )
		{
			return false;
		}

		/**
		 * @var DateTimeValueBase $other
		 */
		$other = $obj;
		return $this->ToString( null ) == $other->ToString( null );
	}
778980
protected function parseSuppliedTimezone($timezone)
        {
            if ($timezone instanceof \DateTimeZone or is_null($timezone)) {
                return $timezone;
            }

            try {
                $timezone = new \DateTimeZone($timezone);
            }
            catch (Exception $error) {
                throw new \InvalidArgumentException('The supplied timezone [' . $timezone . '] is not supported.');
            }

            return $timezone;
        }
195034
public function contains(ValueObjectInterface $object)
    {
        foreach ($this->items as $item) {
            if ($item->sameValueAs($object)) {
                return true;
            }
        }

        return false;
    }
1231037
public static function setTimeZone($timezone)
    {
        if (self::_validateTimezone($timezone)) {
            self::$timezone = $timezone;
            return true;
        }
        return false;
    }
1266421
public function sameValueAs(ValueObjectInterface $date)
    {
        if (false === Util::classEquals($this, $date)) {
            return false;
        }

        return $this->getYear()->sameValueAs($date->getYear()) &&
               $this->getMonth()->sameValueAs($date->getMonth()) &&
               $this->getDay()->sameValueAs($date->getDay());
    }
274224
final protected function _getTimeZone($timezone = null)
	{
		if ($timezone = strtoupper($timezone) and defined("\\DateTimeZone::{$timezone}")) {
			$timezone = new \DateTimeZone($timezone);
		} elseif (! ($timezone instanceof \DateTimeZone)) {
			@date_default_timezone_set(date_default_timezone_get());
			$timezone = new \DateTimeZone(date_default_timezone_get());
		}
		return $timezone;
	}
737599
protected static function getTimezoneObject($tz)
    {
        // If the time zone object is not set, attempt to build it.
        if (!($tz instanceof \DateTimeZone)) {
            if ($tz === null) {
                $tz = static::useServerDefaultTimezone() ? self::$stz : self::$gmt;
            } elseif (is_string($tz)) {
                $tz = new \DateTimeZone($tz);
            } elseif ($tz === static::TZ_LOCALE) {
                $config = Ioc::getConfig();
                $tz     = $config->get('system.timezone');
                $tz     = new \DateTimeZone($tz);
            }
        }

        return $tz;
    }
1180098
private static function isValidTimezone(string $timezone): bool
    {
        // @codeCoverageIgnoreStart
        if (self::$timezones === null) {
            self::$timezones = [];
            foreach (timezone_identifiers_list() as $zone) {
                self::$timezones[$zone] = true;
            }
        }
        // @codeCoverageIgnoreEnd

        return isset(self::$timezones[$timezone]);
    }
744
public function setTimeZone(\DateTimeZone $timeZone = null)
    {
        if ($timeZone) {
            $value = $timeZone->getName();
        } else {
            $value = null;
        }

        $this->setValue('timezone', $value);
    }
565915
public static function isTimezone($value): bool
    {
        if ($value instanceof DateTimeZone) {
            return true;
        }

        if (!static::isStringCastable($value)) {
            return false;
        }

        return self::isValidTimezone((string) $value);
    }
1104462
public function toDateTime(\DateTimeZone $timeZone = null): \DateTime
    {
        if (null === self::$utc) {
            self::$utc = new \DateTimeZone('UTC');
        }

        $date = \DateTime::createFromFormat('!Y-m-d', $this->getValue(), $timeZone ?: self::$utc);
        if (!$date instanceof \DateTime) {
            $date = \DateTime::createFromFormat('!Y-m-d', (new \DateTime())->format('Y-m-d'), $timeZone ?: self::$utc);
        }

        if ($date->getOffset() !== 0) {
            $date->setTimezone(self::$utc);
        }

        return $date;
    }
1368710
public static function defaultTimezone($timezone = null)
	{
		if ($timezone !== null)
		{
			if ( ! $timezone instanceOf DateTimeZone)
			{
				$timezone = new DateTimeZone($timezone);
			}

			static::$defaultTimezone = $timezone;
		}

		return static::$defaultTimezone;
	}
712348
public function sameTimestampAs(ValueObjectInterface $dateTimeWithTimeZone)
    {
        if (false === Util::classEquals($this, $dateTimeWithTimeZone)) {
            return false;
        }

        return $this->toNativeDateTime() == $dateTimeWithTimeZone->toNativeDateTime();
    }
1202426
public function containsExclusive(TimezonedDateTime $timezonedDateTime) : bool
    {
        return $this->start->comesBefore($timezonedDateTime) && $this->end->comesAfter($timezonedDateTime);
    }
977910
public function compare(QDateTime $dttCompare)
    {
        // All comparison operations MUST have operands with matching Date Nullstates
        if ($this->blnDateNull && !$dttCompare->blnDateNull) {
            return -1;
        } elseif (!$this->blnDateNull && $dttCompare->blnDateNull) {
            return 1;
        }

        // If mismatched Time nullstates, then only compare the Date portions
        if ($this->blnTimeNull != $dttCompare->blnTimeNull) {
            // Let's "Null Out" the Time
            $dttThis = new QDateTime($this);
            $dttThat = new QDateTime($dttCompare);
            $dttThis->Hour = null;
            $dttThat->Hour = null;
        } else {
            $dttThis = $this;
            $dttThat = $dttCompare;
        }
        return ($dttThis->Timestamp < $dttThat->Timestamp ? -1 : ($dttThis->Timestamp == $dttThat->Timestamp ? 0 : 1));
    }