DateTime::setTimezone
PHP 5 >= 5.2.0, PHP 7, PHP 8
DateTime::setTimezone - Sets the time zone for the DateTime object
Manual
DateTime::setTimezone(
DateTimeZone$timezone ): public DateTime
Procedural style
DateTimedate_timezone_set DateTimeobject DateTimeZonetimezoneParameters
- object
Procedural style only: A DateTime object returned by date_create. The function modifies this object.
- timezone
-
A DateTimeZone object representing the desired time zone.
Return Values
Returns the DateTime object for method chaining.