public function formatForJson(): string
    {
        $date = $this->setTimezone(new \DateTimeZone('Etc/UTC'));
        $result = $date->format('Y-m-d\TH:i:s');
        $milliseconds = \floor($date->format('u') / 1000);

        if ($milliseconds > 0) {
            $result .= '.'.\str_pad((string) $milliseconds, 3, '0', \STR_PAD_LEFT);
        }

        return $result.'Z';
    }