|
DateTime::setTimezonedate_timezone_setSets the time zone for the DateTime object DescriptionObject oriented style
public DateTime DateTime::setTimezone
( DateTimeZone
$timezone
)Procedural style
DateTime date_timezone_set
( DateTime
$object
, DateTimeZone $timezone
)Sets a new timezone for a DateTime object. Parameters
Return Values
Returns the DateTime object for method chaining or Changelog
ExamplesExample #1 DateTime::setTimeZone example Object oriented style
<?php Procedural style
<?php The above examples will output: 2000-01-01 00:00:00+12:00 2000-01-01 01:45:00+13:45 See Also
|