|
The DateTimeInterface interfaceIntroductionDateTimeInterface was created so that parameter, return, or property type declarations may accept either DateTimeImmutable or DateTime as a value. It is not possible to implement this interface with userland classes. Common constants that allow for formatting DateTimeImmutable or DateTime objects through DateTimeImmutable::format and DateTime::format are also defined on this interface. Interface synopsis
DateTimeInterface
/* Constants */
public
const
string
DateTimeInterface::ATOM = "Y-m-d\\TH:i:sP";
public
const
string
DateTimeInterface::COOKIE = "l, d-M-Y H:i:s T";
public
const
string
DateTimeInterface::ISO8601 = "Y-m-d\\TH:i:sO";
public
const
string
DateTimeInterface::ISO8601_EXPANDED = "X-m-d\\TH:i:sP";
public
const
string
DateTimeInterface::RFC822 = "D, d M y H:i:s O";
public
const
string
DateTimeInterface::RFC850 = "l, d-M-y H:i:s T";
public
const
string
DateTimeInterface::RFC1036 = "D, d M y H:i:s O";
public
const
string
DateTimeInterface::RFC1123 = "D, d M Y H:i:s O";
public
const
string
DateTimeInterface::RFC7231 = "D, d M Y H:i:s \\G\\M\\T";
public
const
string
DateTimeInterface::RFC2822 = "D, d M Y H:i:s O";
public
const
string
DateTimeInterface::RFC3339 = "Y-m-d\\TH:i:sP";
public
const
string
DateTimeInterface::RFC3339_EXTENDED = "Y-m-d\\TH:i:s.vP";
public
const
string
DateTimeInterface::RSS = "D, d M Y H:i:s O";
public
const
string
DateTimeInterface::W3C = "Y-m-d\\TH:i:sP";
/* Methods */
public DateInterval DateTimeInterface::diff(DateTimeInterface
$targetObject , bool $absolute = false )public string DateTimeInterface::format(string
$format )public int DateTimeInterface::getOffset()
public int DateTimeInterface::getTimestamp()
public DateTimeZonefalse DateTimeInterface::getTimezone()
public void DateTimeInterface::__wakeup()
Predefined Constants
Changelog
|