name = $tz->getName(); } catch (\Exception) { throw new \InvalidArgumentException(sprintf('Invalid timezone identifier: "%s".', $name)); } } public static function utc(): self { return new self('UTC'); } public function toDateTimeZone(): \DateTimeZone { return new \DateTimeZone($this->name); } #[\Override] public function __toString(): string { return $this->name; } #[\Override] public function equals(mixed $other): bool { return $other instanceof self && $this->name === $other->name; } }