final class DateTime extends DateTimeImmutable implements JsonSerializable

Immutable date-time value with JSON and string serialization support.

Methods

string
jsonSerialize()

Returns JSON representation in ISO 8601 (used by JavaScript).

string
__toString()

Returns the date and time in the format 'Y-m-d H:i:s.u'.

Details

at line 19
string jsonSerialize()

Returns JSON representation in ISO 8601 (used by JavaScript).

Return Value

string

at line 28
string __toString()

Returns the date and time in the format 'Y-m-d H:i:s.u'.

Return Value

string