protected function formatDateTime(DateTimeInterface $date): string
    {
        return (new DateTime)
            ->setTimestamp($date->getTimestamp())
            ->setTimezone(new DateTimeZone('UTC'))
            ->format('Y-m-d\TH:i:s\Z');
    }
protected function formatDateTime(DateTimeInterface $date): string
    {
        return (new DateTime)
            ->setTimestamp($date->getTimestamp())
            ->setTimezone(new DateTimeZone('UTC'))
            ->format('Y-m-d\TH:i:s\Z');
    }
protected function formatDateTime ( DateTimeInterface $ date ) : string { return ( new DateTime ) -> setTimestamp ( $ date -> getTimestamp ( ) ) -> setTimezone ( new DateTimeZone ( 'UTC' ) ) -> format ( 'Y-m-d\TH:i:s\Z' ) ; }
Use UTC time zone and return ISO-8601 format.
Use UTC time zone and return ISO - 8601 format .