src/Type/DateTimeType.php
private function convertToUtc(\DateTimeInterface $date)
    {
        if ($date->getOffset() !== 0) {
            if (null === $this->utc) {
                $this->utc = new \DateTimeZone('UTC');
            }

            if ($date instanceof \DateTimeImmutable) {
                $date = \DateTime::createFromFormat(
                    DateUtils::ISO8601_ZULU,
                    $date->format(DateUtils::ISO8601_ZULU)
                );
            }

            $date->setTimezone($this->utc);
            $date = \DateTimeImmutable::createFromMutable($date);
        }

        return $date;
    }
private function convertToUtc(\DateTimeInterface $date)
    {
        if ($date->getOffset() !== 0) {
            if (null === $this->utc) {
                $this->utc = new \DateTimeZone('UTC');
            }

            if ($date instanceof \DateTimeImmutable) {
                $date = \DateTime::createFromFormat(
                    DateUtils::ISO8601_ZULU,
                    $date->format(DateUtils::ISO8601_ZULU)
                );
            }

            $date->setTimezone($this->utc);
            $date = \DateTimeImmutable::createFromMutable($date);
        }

        return $date;
    }
@param \DateTimeInterface $date

@return \DateTimeInterface