From 1294cb524017f2eeda5cfc9c963e1555eb917e6f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 6 May 2020 12:45:27 +0200 Subject: [PATCH] [HttpFoundation] fix perf of ResponseHeaderBag::initDate() --- src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php b/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php index 5acefc9c969e0..76e11ce36e5c5 100644 --- a/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php +++ b/src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php @@ -286,8 +286,6 @@ protected function computeCacheControlValue() private function initDate(): void { - $now = \DateTime::createFromFormat('U', time()); - $now->setTimezone(new \DateTimeZone('UTC')); - $this->set('Date', $now->format('D, d M Y H:i:s').' GMT'); + $this->set('Date', gmdate('D, d M Y H:i:s').' GMT'); } }