PHP: DateTimeImmutable - Manual (original) (raw)

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

Introduction

Representation of date and time.

This class behaves the same as DateTime except new objects are returned when modification methods such asDateTime::modify() are called.

Class synopsis

/* Inherited constants */

/* Methods */

}

Changelog

Version Description
8.4.0 The class constants are now typed.
7.1.0 The DateTimeImmutable constructor now includes the current microseconds in the constructed value. Before this, it would always initialise the microseconds to 0.