|
DateTime::__constructReturns new DateTime object Description
public DateTime::__construct(string
$datetime = "now", DateTimeZonenull $timezone = null )Like DateTimeImmutable::__construct but works with DateTime. Consider using the DateTimeImmutable and features instead. Returns a new DateTime object. Parameters
Return ValuesReturns a new DateTime instance. Errors/ExceptionsIf an invalid Date/Time string is passed, DateMalformedStringException is thrown. Previous to PHP 8.3, this was Exception. Changelog
See Also
|