(PHP 5 >= 5.5.0, PHP 7, PHP 8)
date_create_immutable — 创建一个新的 DateTimeImmutable 对象
$datetime = "now", ?DateTimeZone $timezone = null): DateTimeImmutable|false这是 DateTimeImmutable::__construct() 的过程化版本。
与 DateTimeImmutable 构造函数不同,如果传入的 datetime 字符串无效,它将返回 false 而不是异常。
返回一个新的 DateTimeImmutable 实例,或在失败时返回 false