Update the timezone of the DateTime object.
<?php $date=date_create(“2013-05-25”,timezone_open(“Indian/Kerguelen”)); echo date_format($date,“Y-m-d H:i:sP”); ?> |
The date_timezone_set() function updates the time zone of the DateTime object.
date_timezone_set(object, timezone) |
Parameter |
Description |
object |
Required. Specifies a DateTime object created by |
timezone |
Required. Specifies a DateTimeZone object representing the desired time zone. |
Return Value: |
Returns the DateTime object for method chaining on success. FALSE on failure. |
PHP Version: |
5.2+ |
Changelog: |
PHP 5.3: Changed the return value from NULL to DateTime on success. |