You are here

public function Response::setDate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::setDate()

Sets the Date header.

Parameters

\DateTime $date A \DateTime instance:

Return value

Response

1 call to Response::setDate()
Response::__construct in vendor/symfony/http-foundation/Response.php
Constructor.

File

vendor/symfony/http-foundation/Response.php, line 621

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setDate(\DateTime $date) {
  $date
    ->setTimezone(new \DateTimeZone('UTC'));
  $this->headers
    ->set('Date', $date
    ->format('D, d M Y H:i:s') . ' GMT');
  return $this;
}