Returns the time zone associated with this user. This time zone must be
used when interpreting all date/time restrictions related to this user.

@return
The time zone associated with this user.
321071
private TimeZone getTimeZone() {

        // If no time zone is set, use the default
        String timeZone = getModel().getTimeZone();
        if (timeZone == null)
            return TimeZone.getDefault();

        // Otherwise parse and return time zone
        return TimeZone.getTimeZone(timeZone);

    }
163860
public function timezone()
	{
		$params = array(
			$this->database,
			$this->user,
			$this->password
		);

		return $this->getClient('common')->call('timezone_get', $params);
	}
624585
@Deprecated
    public static TimeZone getTimeZone(Date self) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(self);
        return calendar.getTimeZone();
    }
784365
public PlainDate today() {

        final UnixTime ut = this.timeSource.currentTime();
        Timezone tz = (this.timezone == null) ? Timezone.ofSystem() : this.timezone;
        return PlainDate.from(ut, tz.getOffset(ut));

    }
1022021
public static function timezone()
    {
        if (!self::isDebug()) {
            return false;
        }

        $data = date_default_timezone_get();
        return self::i()->dump($data, '! timezone !');
    }
1120472
public Double getNearestTime(double timePercentage) {
		//the arrays should be sorted by time so this step is probably not needed
		Double minTime = null;
		Double maxTime = null;
		for (Double t : time) {
			if (minTime == null || t < minTime) {
				minTime = t;
			}
			if (maxTime == null || t > maxTime) {
				maxTime = t;
			}
		}
		Double timeRange = maxTime - minTime;
		Double targetTime = minTime + timePercentage * timeRange;
		Double previousTime = null;
		for (Double t : time) {
			if (previousTime == null || t <= targetTime) {
				previousTime = t;
			} else {
				return previousTime;
			}
		}
		return previousTime;
	}
962891
public static function get_server_timezone() {
        global $CFG;

        if (!isset($CFG->timezone) or $CFG->timezone == 99 or $CFG->timezone === '') {
            return self::get_default_php_timezone();
        }

        return self::normalise_timezone($CFG->timezone);
    }
1056815
public function getDisplayTimeZone()
    {
        if (empty($this->_displayTimeZone)) {
            if (!empty(Yii::$app->params['dateControlDisplayTimezone'])) {
                $this->_displayTimeZone = Yii::$app->params['dateControlDisplayTimezone'];
            } else {
                $this->_displayTimeZone = Yii::$app->getTimeZone();
            }
        }
        
        return $this->_displayTimeZone;
    }
70674
public static TimeZone getTimeZoneById(String id)
    {
        TimeZone ret = null;
        if(timezones != null)
        {
            for(int i = 0; i < timezones.length && ret == null; i++)
            {
                if(timezones[i].getId().equals(id))
                    ret = timezones[i].getTimeZone();
            }
        }
        return ret;
    }
462022
public function getTimezone()
    {
        if(!$timezone = $this->getUser()->getLanguage()) {
            $timezone = $this->getConfig()->timezone;
        }

        return $timezone;
    }
436359
public java.util.Date getDateWithZone(ZoneId timezone) {
        LocalDate pickerDate = parentDatePicker.getDate();
        if (pickerDate == null || timezone == null) {
            return null;
        }
        Instant instant = pickerDate.atStartOfDay(timezone).toInstant();
        // for backport: java.util.Date javaUtilDate = DateTimeUtils.toDate(instant);
        // for java.time: java.util.Date javaUtilDate = java.util.Date.from(instant);
        // This function was created to be compatible with both libraries.
        java.util.Date javaUtilDate = getJavaUtilDateFromInstant(instant);
        return javaUtilDate;
    }
467029
private function getDateTime()
    {
        $timezone = new \DateTimeZone($this->options['timezone']);
        $dateTime = new \DateTime('now');
        $dateTime->setTimezone($timezone);
        return $dateTime;
    }
1209134
private SimpleDateFormat getDateTimeFormatter() {
		SimpleDateFormat formatter = new SimpleDateFormat();
		formatter.applyPattern("yyyy-MM-dd'T'HH:mm:ss");
		formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
		return formatter;
	}
1117790
public F getInstance() {
		return getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, TimeZone.getDefault(), Locale.getDefault());
	}
254832
public function getTimezone()
    {
        $dateTime = new Date();
        $dateTime->setTimeZone(new DateTimeZone($this->cachetTimezone));

        return $dateTime->format('T');
    }
1275034
public static ZoneId getTimeZoneId(final TimeZone tz) {
        return ZoneId.of(tz.getID(), ZoneId.SHORT_IDS);
    }
1155478
private static DateTimeZone getTimeZone(String id) {
    DateTimeZone zone;
    try {
      zone = DateTimeZone.forID(id);
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException("TimeZone " + id + " not recognized");
    }
    return zone;
  }