date_create_immutable

create a new `DateTimeImmutable` object

&reftitle.description; ``DateTimeImmutable``false```date_create_immutable` `string` `datetime`"now" ``DateTimeZone``null```timezone`&null;

This is the procedural version of `DateTimeImmutable::__construct`.

Unlike the `DateTimeImmutable` constructor, it will return &false; instead of an exception if the passed in `datetime` string is invalid.

&reftitle.parameters;

See DateTimeImmutable::__construct.

&reftitle.returnvalues;

Returns a new DateTimeImmutable instance &return.falseforfailure;

&reftitle.seealso;

- `DateTimeImmutable::createFromFormat`