DateTime
JsonSerializable
A simple DateTime
wrapper with predefined formats which supports stringification and JSON.
Type | Format |
---|---|
pq\Types::DATE | "Y-m-d" |
pq\Types::TIMESTAMP | "Y-m-d H:i:s.u" |
pq\Types::TIMESTAMPTZ | "Y-m-d H:i:s.uO" |
NOTE:
Date/time values will only be converted to pq\DateTime and fromDateTime
if the pq\Result::CONV_DATETIME bit is set in pq\Result::$autoConvert.
string
$format# = "Y-m-d H:i:s.uO"Stringify the DateTime
instance according to pq\DateTime::$format.
Serialize to JSON.