Zend\Http\Header\Date
Date Header
Synopsis
class Date
extends AbstractDate
{
- // Inherited constants from AbstractDate
- const DATE_RFC1123 = 0;
- const DATE_RFC1036 = 1;
- const DATE_ANSIC = 2;
- // Inherited members from AbstractDate
- protected DateTime $date;
- protected string $dateFormat;
- protected array $dateFormats;
- // methods
- public string getFieldName()
- // Inherited methods from AbstractDate
- public static AbstractDate fromString()
- public static void setDateFormat()
- public static string getDateFormat()
- public AbstractDate setDate()
- public string getDate()
- public DateTime date()
- public int compareTo()
- public string getFieldValue()
- public string toString()
- public string __toString()
Hierarchy
Extends
Constants
Name | Value |
---|---|
DATE_RFC1123 | 0 |
DATE_RFC1036 | 1 |
DATE_ANSIC | 2 |
Members
protected
- $date
—
DateTime
Date instance for this header - $dateFormat
—
string
Date output format - $dateFormats
—
array
Date formats defined by RFC 2616. RFC 1123 date is required RFC 1036 and ANSI C formats are provided for compatibility with old servers/clients
Methods
public
- getFieldName() — Get header name
Inherited from Zend\Http\Header\AbstractDate
public
- __toString() — Allow casting to string
- compareTo() — 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.
- date() — Return date for this header as an instance of \DateTime
- fromString() — Create date-based header from string
- getDate() — Return date for this header
- getDateFormat() — Return current date output format
- getFieldValue() — Get header value as formatted date
- setDate() — Set the date for this header, this can be a string or an instance of \DateTime
- setDateFormat() — Set date output format
- toString() — Return header line