Back to User class

Method getTimezone

public \DateTimeZone
getTimezone
()
Method to get the user timezone.
Returns
  • \DateTimeZone
Since
  • 3.7.0
Class: User
Project: Joomla

Method getTimezone - Source code

/**
 * Method to get the user timezone.
 *
 * If the user didn't set a timezone, it will return the server timezone
 *
 * @return \DateTimeZone
 *
 * @since 3.7.0
 */
public function getTimezone()
{
    $timezone = $this->getParam('timezone', Factory::getApplication()->get('offset', 'GMT'));
    return new \DateTimeZone($timezone);
}