Search Results
Return Values ¶ Returns a new modified DateTimeImmutable object for method chaining. The underlaying point-in-time is not changed when calling this method.
Aug 21, 2025 · At its core, DateTimeImmutable::setTimezone () is a method of the DateTimeImmutable class in PHP. Its primary purpose is to create a new DateTimeImmutable object with a modified time zone while preserving the original object's state. This immutability is a crucial feature that distinguishes it from its mutable counterpart, DateTime::setTimezone ().
Return Values Returns a new modified DateTimeImmutable object for method chaining. The underlaying point-in-time is not changed when calling this method.
Return Values Returns a new modified DateTimeImmutable object for method chaining. The underlaying point-in-time is not changed when calling this method.
Valeurs de retour Retourne un nouvel objet modifié DateTimeImmutable pour chaîner les méthodes. Le point dans le temps sous-jacent n'est pas modifié lors de l'appel de cette méthode.
Oct 11, 2019 · The DateTimeImmutable::setTimezone () function is an inbuilt function in PHP which is used to set the time zone for the created DateTimeImmutable object. This function returns the DateTimeImmutable object or False on failure.
DateTimeImmutable::setISODate — Sets the ISO date DateTimeImmutable::setTime — Sets the time DateTimeImmutable::setTimestamp — Sets the date and time based on a Unix timestamp DateTimeImmutable::setTimezone — Sets the time zone DateTimeImmutable::sub — Subtracts an amount of days, months, years, hours, minutes and seconds
