src/ZonedDateTime.php
public static function from(DateTimeParseResult $result) : ZonedDateTime
    {
        $localDateTime = LocalDateTime::from($result);

        $timeZoneOffset = TimeZoneOffset::from($result);

        if ($result->hasField(Field\TimeZoneRegion::NAME)) {
            $timeZone = TimeZoneRegion::from($result);
        } else {
            $timeZone = $timeZoneOffset;
        }

        return ZonedDateTime::of(
            $localDateTime,
            $timeZone
        );
    }
public static function from(DateTimeParseResult $result) : ZonedDateTime
    {
        $localDateTime = LocalDateTime::from($result);

        $timeZoneOffset = TimeZoneOffset::from($result);

        if ($result->hasField(Field\TimeZoneRegion::NAME)) {
            $timeZone = TimeZoneRegion::from($result);
        } else {
            $timeZone = $timeZoneOffset;
        }

        return ZonedDateTime::of(
            $localDateTime,
            $timeZone
        );
    }
public static function from ( DateTimeParseResult $ result ) : ZonedDateTime { $ localDateTime = LocalDateTime :: from ( $ result ) ; $ timeZoneOffset = TimeZoneOffset :: from ( $ result ) ; if ( $ result -> hasField ( Field \ TimeZoneRegion :: NAME ) ) { $ timeZone = TimeZoneRegion :: from ( $ result ) ; } else { $ timeZone = $ timeZoneOffset ; } return ZonedDateTime :: of ( $ localDateTime , $ timeZone ) ; }
Obtains an instance of `ZonedDateTime` from a set of date-time fields.

This method is only useful to parsers.

@param DateTimeParseResult $result

@return ZonedDateTime

@throws DateTimeException      If the zoned date-time is not valid.
@throws DateTimeParseException If required fields are missing from the result.
Obtains an instance of ZonedDateTime from a set of date - time fields .