Sets up the _timezone attribute.

    Args:
      timezone: Timezone name (optional)
436214
def setup(self, timezone=None):  # pylint: disable=arguments-differ
    
    self._timezone = timezone
    self._output_path = tempfile.mkdtemp()
228766
public function setTimezone(DateTimeZone $timezone)
    {
        if($this->_date->setTimezone($timezone) === false) {
            return false;
        }

        return $this;
    }
1279262
public function setTimeZone() {
        $timezone = \Yii::$app->session->get($this->timezoneSessionKey);
        if ($timezone === null) {
            $timezone = \Yii::$app->request->cookies->getValue($this->timezoneCookieName);
            \Yii::$app->formatter->timeZone = $timezone;
        } else {
            \Yii::$app->formatter->timeZone = $timezone;
        }

    }
328600
public void setTimeZoneID(String timeZoneId) {
        if (verifyTimeZoneID(timeZoneId)) {
            this.timeZone = TimeZone.getTimeZone(timeZoneId);
        } else {
            throw new IllegalArgumentException(timeZoneId + " is not a valid time zone");
        }

    }
865815
public void setTimeZone(TimeZone value)
    {
        zone = value;
        sharedZone = false;
        /* Recompute the fields from the time using the new zone.  This also
         * works if isTimeSet is false (after a call to set()).  In that case
         * the time will be computed from the fields using the new zone, then
         * the fields will get recomputed from that.  Consider the sequence of
         * calls: cal.setTimeZone(EST); cal.set(HOUR, 1); cal.setTimeZone(PST).
         * Is cal set to 1 o'clock EST or 1 o'clock PST?  Answer: PST.  More
         * generally, a call to setTimeZone() affects calls to set() BEFORE AND
         * AFTER it up to the next call to complete().
         */
        areAllFieldsSet = areFieldsSet = false;
    }
1237970
public final void setTimeZone(final TimeZone timezone) {
        getStart().setUtc(false);
        getStart().setTimeZone(timezone);
        getEnd().setUtc(false);
        getEnd().setTimeZone(timezone);
    }
1211349
def enforce_timezone(&block)
      begin
        if @force_timezone
          zone = ActiveRecord::Base.default_timezone
          ActiveRecord::Base.default_timezone = @force_timezone
        end

        yield if block_given?
      ensure
        ActiveRecord::Base.default_timezone = zone if @force_timezone
      end
    end
270114
def _SetExtractionPreferredTimeZone(self, knowledge_base):
    
    # Note session.preferred_time_zone will default to UTC but
    # self._preferred_time_zone is None when not set.
    if self._preferred_time_zone:
      try:
        knowledge_base.SetTimeZone(self._preferred_time_zone)
      except ValueError:
        # pylint: disable=protected-access
        logger.warning(
            'Unsupported time zone: {0:s}, defaulting to {1:s}'.format(
                self._preferred_time_zone, knowledge_base._time_zone.zone))
127180
public function setTimeZone($timeZone)
    {
        if ($timeZone instanceof \IntlTimeZone) {
            $timeZone = $timeZone->getID();
        }

        if ($timeZone instanceof \DateTimeZone) {
            $timeZone = $timeZone->getName();

            // DateTimeZone returns the GMT offset timezones without the leading GMT, while our parsing requires it.
            if (!empty($timeZone) && ('+' === $timeZone[0] || '-' === $timeZone[0])) {
                $timeZone = 'GMT'.$timeZone;
            }
        }

        return $this->setTimeZoneId($timeZone);
    }
1318282
public function setTimezone($timezone)
	{
		if ( ! $timezone instanceOf DateTimeZone)
		{
			if ($timezone === null)
			{
				$timezone = static::defaultTimezone();
			}
			else
			{
				$timezone = new DateTimeZone($timezone);
			}
		}

		$this->datetime->setTimezone($timezone);

		return $this;
	}
1181156
function () {
    var tzGuess = moment.tz.guess() || 'UTC';
    setCustomerTimezone(tzGuess);

    // Add the guessed customer timezone to list if its unknwon
    var knownTimezone = $.grep(timezones, function (tz) {
      return tz.key === customerTimezone
    }).length > 0
    if (!knownTimezone) {
      var name = '(' + moment().tz(customerTimezone).format('Z') + ') ' + customerTimezone
      timezones.unshift({
        key: customerTimezone,
        name: name
      });
    }
  }
1251658
def set_location(self, time, latitude, longitude):
        '''
        
        '''
        if isinstance(time, datetime.datetime):
            tzinfo = time.tzinfo
        else:
            tzinfo = time.tz

        if tzinfo is None:
            self.location = Location(latitude, longitude)
        else:
            self.location = Location(latitude, longitude, tz=tzinfo)
1207534
def set_time(self, time):
        '''
        
        '''
        times = num2date(time[:].squeeze(), time.units)
        self.time = pd.DatetimeIndex(pd.Series(times), tz=self.location.tz)
1000497
def set_timestamp_to_current(self):
        
        # Good form to add tzinfo
        self.timestamp = pytz.UTC.localize(datetime.datetime.utcnow())
1279664
def AddTimeZoneOption(self, argument_group):
    
    # Note the default here is None so we can determine if the time zone
    # option was set.
    argument_group.add_argument(
        '-z', '--zone', '--timezone', dest='timezone', action='store',
        type=str, default=None, help=(
            'explicitly define the timezone. Typically the timezone is '
            'determined automatically where possible otherwise it will '
            'default to UTC. Use "-z list" to see a list of available '
            'timezones.'))
1213200
def adjust_datetime_to_timezone(value, from_tz, to_tz=None):
    
    if to_tz is None:
        to_tz = settings.TIME_ZONE
    if value.tzinfo is None:
        if not hasattr(from_tz, "localize"):
            from_tz = pytz.timezone(smart_str(from_tz))
        value = from_tz.localize(value)
    return value.astimezone(pytz.timezone(smart_str(to_tz)))
507546
def propagate_timezone_option(self):
        
        if self.use_timezone:
            # first apply myself
            os.environ['TZ'] = self.use_timezone
            time.tzset()

            tab = [self.schedulers, self.pollers, self.brokers, self.receivers, self.reactionners]
            for sat_list in tab:
                for sat in sat_list:
                    if sat.use_timezone == 'NOTSET':
                        setattr(sat, 'use_timezone', self.use_timezone)