mdref.json config
[mdref/mdref-pq] / pq / DateTime.md
1 # class pq\DateTime extends DateTime implements JsonSerializable
2
3 A simple DateTime wrapper with predefined formats which supports stringification and JSON.
4
5 ## Formats:
6
7 Type | Format
8 -----|-------
9 pq\Types::DATE | "Y-m-d"
10 pq\Types::TIMESTAMP | "Y-m-d H:i:s.u"
11 pq\Types::TIMESTAMPTZ | "Y-m-d H:i:s.uO"
12
13 > ***NOTE:***
14 Date/time values will only be converted to pq\DateTime and from DateTime if the pq\Result::CONV_DATETIME bit is set in pq\Result::$autoConvert.
15
16 ## Properties:
17
18 * public string $format = "Y-m-d H:i:s.uO"
19 The default format of any date/time type automatically converted by pq\Result (depends on the actual type of the column).
20
21
22