Abstract Date/Time Header Supports headers that have date/time as value

see \Zend\Http\Header\Date
see \Zend\Http\Header\Expires
see \Zend\Http\Header\IfModifiedSince
see \Zend\Http\Header\IfUnmodifiedSince
see \Zend\Http\Header\LastModified
category Zend
package Zend_Http

 Methods

Allow casting to string

__toString() : string

Returns

string

Compare provided date to date for this header Returns < 0 if date in header is less than $date; > 0 if it's greater, and 0 if they are equal.

compareTo(string | \DateTime $date) : int

see \strcmp()

Parameters

$date

string\DateTime

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Returns

int

Return date for this header as an instance of \DateTime

date() : \DateTime

Returns

Create date-based header from string

fromString(string $headerLine) : \Zend\Http\Header\AbstractDate

Return date for this header

getDate() : string

Returns

string

Return current date output format

getDateFormat() : string

Returns

string

getFieldName()

getFieldName() 
Inherited

inherited_from \Zend\Http\Header\HeaderInterface::getFieldName()

Get header value as formatted date

getFieldValue() : string

Returns

string

Set the date for this header, this can be a string or an instance of \DateTime

setDate(string | \DateTime $date) : \Zend\Http\Header\AbstractDate

Set date output format

setDateFormat(int $format) 

Parameters

$format

int

Exceptions

\Zend\Http\Header\Exception\InvalidArgumentException

Return header line

toString() : string

Returns

string

 Properties

 

Date instance for this header

$date : \DateTime

 

Date output format

$dateFormat : string

 

Date formats defined by RFC 2616.

$dateFormats : array

RFC 1123 date is required RFC 1036 and ANSI C formats are provided for compatibility with old servers/clients

link http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3

 Constants

 

DATE_ANSIC

DATE_ANSIC 

 

DATE_RFC1036

DATE_RFC1036 

 

Date formats according to RFC 2616

DATE_RFC1123