src/Carbon/CarbonTimeZone.php
public static function instance($object = null, $objectDump = null)
    {
        $tz = $object;

        if ($tz instanceof static) {
            return $tz;
        }

        if ($tz === null) {
            return new static();
        }

        if (!$tz instanceof DateTimeZone) {
            $tz = static::getDateTimeZoneFromName($object);
        }

        if ($tz === false) {
            if (Carbon::isStrictModeEnabled()) {
                throw new InvalidArgumentException('Unknown or bad timezone ('.($objectDump ?: $object).')');
            }

            return false;
        }

        return new static($tz->getName());
    }
public static function instance($object = null, $objectDump = null)
    {
        $tz = $object;

        if ($tz instanceof static) {
            return $tz;
        }

        if ($tz === null) {
            return new static();
        }

        if (!$tz instanceof DateTimeZone) {
            $tz = static::getDateTimeZoneFromName($object);
        }

        if ($tz === false) {
            if (Carbon::isStrictModeEnabled()) {
                throw new InvalidArgumentException('Unknown or bad timezone ('.($objectDump ?: $object).')');
            }

            return false;
        }

        return new static($tz->getName());
    }
public static function instance ( $ object = null , $ objectDump = null ) { $ tz = $ object ; if ( $ tz instanceof static ) { return $ tz ; } if ( $ tz === null ) { return new static ( ) ; } if ( ! $ tz instanceof DateTimeZone ) { $ tz = static :: getDateTimeZoneFromName ( $ object ) ; } if ( $ tz === false ) { if ( Carbon :: isStrictModeEnabled ( ) ) { throw new InvalidArgumentException ( 'Unknown or bad timezone (' . ( $ objectDump ? : $ object ) . ')' ) ; } return false ; } return new static ( $ tz -> getName ( ) ) ; }
Create a CarbonTimeZone from mixed input.

@param DateTimeZone|string|int|null $object     original value to get CarbonTimeZone from it.
@param DateTimeZone|string|int|null $objectDump dump of the object for error messages.

@return false|static
Create a CarbonTimeZone from mixed input .