Back to Date class

Method setTimezone

public \Joomla\CMS\Date\Date
setTimezone
(mixed $tz)
Method to wrap the setTimezone() function and set the internal time zone object.
Parameters
  • \DateTimeZone $tz The new \DateTimeZone object.
Returns
  • \Joomla\CMS\Date\Date
Since
  • 1.7.0
-
  • This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483
Class: Date
Project: Joomla

Method setTimezone - Source code

/**
 * Method to wrap the setTimezone() function and set the internal time zone object.
 *
 * @param   \DateTimeZone  $tz  The new \DateTimeZone object.
 *
 * @return  Date
 *
 * @since   1.7.0
 * @note    This method can't be type hinted due to a PHP bug: https://bugs.php.net/bug.php?id=61483
 */
#[\ReturnTypeWillChange]
public function setTimezone($tz)
{
    $this->tz = $tz;
    return parent::setTimezone($tz);
}