Cake\Network\Response::modified PHP Method

modified() public method

### Examples: $response->modified('now') Will set the Last-Modified to the current time $response->modified(new DateTime('+1 day')) Will set the modification date in the past 24 hours $response->modified() Will return the current Last-Modified header value
public modified ( string | DateTime | null $time = null ) : string | null
$time string | DateTime | null Valid time string or \DateTime instance.
return string | null
    public function modified($time = null)
    {
        if ($time !== null) {
            $date = $this->_getUTCDate($time);
            $this->_headers['Last-Modified'] = $date->format('D, j M Y H:i:s') . ' GMT';
        }
        if (isset($this->_headers['Last-Modified'])) {
            return $this->_headers['Last-Modified'];
        }
        return null;
    }