public function zonedDateTimeFrom(TemporalAccessor $temporal) { try { $zone = ZoneId::from($temporal); try { $instant = Instant::from($temporal); return $this->zonedDateTime($instant, $zone); } catch (DateTimeException $ex1) { $cldt = ChronoLocalDateTimeImpl::ensureValid($this, $this->localDateTime($temporal)); return ChronoZonedDateTimeImpl::ofBest($cldt, $zone, null); } } catch (DateTimeException $ex) { throw new DateTimeException("Unable to obtain ChronoZonedDateTime from TemporalAccessor: " . get_class($temporal), $ex); } }
public function atZone(ZoneId $zone) { return ChronoZonedDateTimeImpl::ofBest($this, $zone, null); }