src/TimeZone.php
public static function parse(string $text) : TimeZone
    {
        $text = (string) $text;

        if ($text === 'Z' || $text === 'z') {
            return TimeZoneOffset::utc();
        }

        if ($text === '') {
            throw new DateTimeParseException('The string is empty.');
        }

        if ($text[0] === '+' || $text[0] === '-') {
            return TimeZoneOffset::parse($text);
        }

        return TimeZoneRegion::parse($text);
    }
public static function parse(string $text) : TimeZone
    {
        $text = (string) $text;

        if ($text === 'Z' || $text === 'z') {
            return TimeZoneOffset::utc();
        }

        if ($text === '') {
            throw new DateTimeParseException('The string is empty.');
        }

        if ($text[0] === '+' || $text[0] === '-') {
            return TimeZoneOffset::parse($text);
        }

        return TimeZoneRegion::parse($text);
    }
public static function parse ( string $ text ) : TimeZone { $ text = ( string ) $ text ; if ( $ text === 'Z' || $ text === 'z' ) { return TimeZoneOffset :: utc ( ) ; } if ( $ text === '' ) { throw new DateTimeParseException ( 'The string is empty.' ) ; } if ( $ text [ 0 ] === '+' || $ text [ 0 ] === '-' ) { return TimeZoneOffset :: parse ( $ text ) ; } return TimeZoneRegion :: parse ( $ text ) ; }
Obtains an instance of `TimeZone` from a string representation.

@param string $text

@return TimeZone

@throws \Brick\DateTime\Parser\DateTimeParseException
Obtains an instance of TimeZone from a string representation .