array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ru', ), 'this' => array ( 0 => 'function.date-create-immutable.php', 1 => 'date_create_immutable', ), 'up' => array ( 0 => 'ref.datetime.php', 1 => 'Функции даты и времени', ), 'prev' => array ( 0 => 'function.date-create-immutable-from-format.php', 1 => 'date_create_immutable_from_format', ), 'next' => array ( 0 => 'function.date-create.php', 1 => 'date_create', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ru', 'path' => 'reference/datetime/functions/date-create-immutable.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
date_create_immutable — Создаёт новый объект DateTimeImmutable
$datetime
= "now", ?DateTimeZone $timezone
= null
): DateTimeImmutable|falseАналог метода DateTimeImmutable::__construct() в процедурном стиле.
В отличие от конструктора DateTimeImmutable,
функция вернёт false
, а не выбросит исключение, если переданная
в конструктор строка datetime
указана некорректно.
Смотрите DateTimeImmutable::__construct.
Возвращает новый экземпляр DateTimeImmutable.
или false
, если возникла ошибка