public function getTimezone($returnDateTimeZoneObject = false) {
    if (!empty($this->timezone)) {
      return $returnDateTimeZoneObject
        ? new DateTimeZone($this->timezone)
        : $this->timezone;
    }
    if (isset($this->group->guid) && !empty($this->group->timezone)) {
      return $returnDateTimeZoneObject
        ? new DateTimeZone($this->group->timezone)
        : $this->group->timezone;
    }
    foreach ((array) $this->groups as $curGroup) {
      if (!empty($curGroup->timezone)) {
        return $returnDateTimeZoneObject
          ? new DateTimeZone($curGroup->timezone)
          : $curGroup->timezone;
      }
    }
    $timezone = date_default_timezone_get();
    return $returnDateTimeZoneObject
      ? new DateTimeZone($timezone)
      : $timezone;
  }
public function getTimezone($returnDateTimeZoneObject = false) {
    if (!empty($this->timezone)) {
      return $returnDateTimeZoneObject
        ? new DateTimeZone($this->timezone)
        : $this->timezone;
    }
    if (isset($this->group->guid) && !empty($this->group->timezone)) {
      return $returnDateTimeZoneObject
        ? new DateTimeZone($this->group->timezone)
        : $this->group->timezone;
    }
    foreach ((array) $this->groups as $curGroup) {
      if (!empty($curGroup->timezone)) {
        return $returnDateTimeZoneObject
          ? new DateTimeZone($curGroup->timezone)
          : $curGroup->timezone;
      }
    }
    $timezone = date_default_timezone_get();
    return $returnDateTimeZoneObject
      ? new DateTimeZone($timezone)
      : $timezone;
  }
public function getTimezone ( $ returnDateTimeZoneObject = false ) { if ( ! empty ( $ this -> timezone ) ) { return $ returnDateTimeZoneObject ? new DateTimeZone ( $ this -> timezone ) : $ this -> timezone ; } if ( isset ( $ this -> group -> guid ) && ! empty ( $ this -> group -> timezone ) ) { return $ returnDateTimeZoneObject ? new DateTimeZone ( $ this -> group -> timezone ) : $ this -> group -> timezone ; } foreach ( ( array ) $ this -> groups as $ curGroup ) { if ( ! empty ( $ curGroup -> timezone ) ) { return $ returnDateTimeZoneObject ? new DateTimeZone ( $ curGroup -> timezone ) : $ curGroup -> timezone ; } } $ timezone = date_default_timezone_get ( ) ; return $ returnDateTimeZoneObject ? new DateTimeZone ( $ timezone ) : $ timezone ; }
Return the user's timezone.

First checks if the user has a timezone set, then the primary group, then
the secondary groups, then the system default. The first timezone found
is returned.

@param bool $returnDateTimeZoneObject Whether to return an object of the
DateTimeZone class, instead of an
identifier string.
@return string|DateTimeZone The timezone identifier or the DateTimeZone
object.
Return the user s timezone .