final class DateTime extends DateTimeImmutable implements JsonSerializable

Date Time.

Methods

__construct(string|int $time = 'now')

No description

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 22
__construct(string|int $time = 'now')

No description

Parameters

string|int $time

at line 37
string jsonSerialize()

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

Return Value

string

at line 46
string __toString()

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

Return Value

string

Traits

Strict class for better experience.