Zend\Http\Header\AbstractDate
Abstract Date/Time Header Supports headers that have date/time as value
Synopsis
class AbstractDate
implements
HeaderInterface
{
- // constants
- const DATE_RFC1123 = 0;
- const DATE_RFC1036 = 1;
- const DATE_ANSIC = 2;
- // members
- protected DateTime $date;
- protected string $dateFormat;
- protected array $dateFormats;
- // methods
- 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
Extended by
- Zend\Http\Header\Expires
- Zend\Http\Header\Date
- Zend\Http\Header\LastModified
- Zend\Http\Header\IfModifiedSince
- Zend\Http\Header\RetryAfter
- Zend\Http\Header\IfUnmodifiedSince
Implements
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
- __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