(PHP 5 >= 5.5.0, PHP 7, PHP 8)
Представление даты и времени.
Этот класс ведёт себя так же, как и класс DateTime, за исключением того, что при вызове методов изменения, таких как DateTime::modify(), возвращаются новые объекты.
message: "as DateTimeImmutable::add() does not modify the object itself")]$interval): DateTimeImmutable$format, string $datetime, ?DateTimeZone $timezone = null): DateTimeImmutable|falsemessage: "as DateTimeImmutable::modify() does not modify the object itself")]$modifier): DateTimeImmutablemessage: "as DateTimeImmutable::setDate() does not modify the object itself")]$year, int $month, int $day): DateTimeImmutablemessage: "as DateTimeImmutable::setISODate() does not modify the object itself")]$year, int $week, int $dayOfWeek = 1): DateTimeImmutablemessage: "as DateTimeImmutable::setMicrosecond() does not modify the object itself")]$microsecond): staticmessage: "as DateTimeImmutable::setTime() does not modify the object itself")]$hour,$minute,$second = 0,$microsecond = 0message: "as DateTimeImmutable::setTimestamp() does not modify the object itself")]$timestamp): DateTimeImmutablemessage: "as DateTimeImmutable::setTimezone() does not modify the object itself")]$timezone): DateTimeImmutablemessage: "as DateTimeImmutable::sub() does not modify the object itself")]$interval): DateTimeImmutable
| Версия | Описание |
|---|---|
| 8.4.0 | Константы класса теперь типизированы. |
| 7.1.0 |
Конструктор класса DateTimeImmutable теперь включает текущие микросекунды.
До этого он всегда инициализировал микросекунды со значением 0.
|