DateTime
extends DateTimeImmutable
in package
FinalYes
Marker subclass of DateTimeImmutable used for fields whose schema declares an integer Unix timestamp but should be exposed as a DateTime in PHP (e.g. Message::date). The Serializer converts on the way in (timestamp → DateTime) and out (DateTime → timestamp).
Table of Contents
Methods
- fromTimestamp() : self
- toTimestamp() : int
Methods
fromTimestamp()
public
static fromTimestamp(int $ts) : self
Parameters
- $ts : int
Return values
selftoTimestamp()
public
toTimestamp() : int