Updates the epoch for all subsequent conversions.

        Parameters
        ==========
        year : float
            Decimal year
507912
def set_epoch(self, year):
        

        fa.loadapxsh(self.datafile, np.float(year))
        self.year = year
74666
def _update_time(self):
        
        self.time['steps'] += 1
        # time in days since beginning
        self.time['days_elapsed'] += self.time['timestep'] / const.seconds_per_day
        if self.time['day_of_year_index'] >= self.time['num_steps_per_year']-1:
            self._do_new_calendar_year()
        else:
            self.time['day_of_year_index'] += 1
529086
def _start_date_of_year(year: int) -> datetime.date:
    

    jan_one = datetime.date(year, 1, 1)
    diff = 7 * (jan_one.isoweekday() > 3) - jan_one.isoweekday()

    return jan_one + datetime.timedelta(days=diff)
216993
def interpolate(self, year):
        
        df = self.pivot_table(index=IAMC_IDX, columns=['year'],
                              values='value', aggfunc=np.sum)
        # drop year-rows where values are already defined
        if year in df.columns:
            df = df[np.isnan(df[year])]
        fill_values = df.apply(fill_series,
                               raw=False, axis=1, year=year)
        fill_values = fill_values.dropna().reset_index()
        fill_values = fill_values.rename(columns={0: "value"})
        fill_values['year'] = year
        self.data = self.data.append(fill_values, ignore_index=True)
7154
def _init_dates(self):
        
        if self.total_transactions == 0:
            return None
        self.epoch_start = Result.select(Result.epoch).order_by(Result.epoch.asc()).limit(1).get().epoch
        self.epoch_finish = Result.select(Result.epoch).order_by(Result.epoch.desc()).limit(1).get().epoch
        self.start_datetime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(self.epoch_start))
        self.finish_datetime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(self.epoch_finish))
436467
def replace(self, year=None, month=None, day=None):
        

        if year is None:
            year = self.year
        if month is None:
            month = self.month
        if day is None:
            day = self.day

        if year > 0:
            cls = date
        else:
            cls = extended_date

        return cls(
            year,
            month,
            day
        )
949422
public void setStartYear(int year) {
        if (isFrozen()) {
            throw new UnsupportedOperationException("Attempt to modify a frozen SimpleTimeZone instance.");
        }

        getSTZInfo().sy = year;
        this.startYear = year;
        transitionRulesInitialized = false;
    }
1222451
def set_exp(self, claim='exp', from_time=None, lifetime=None):
        
        if from_time is None:
            from_time = self.current_time

        if lifetime is None:
            lifetime = self.lifetime

        self.payload[claim] = datetime_to_epoch(from_time + lifetime)
44252
public void setYear(int y) {
        super.setValue(y, true, false);

        if (dayChooser != null) {
            dayChooser.setYear(value);
        }

        spinner.setValue(new Integer(value));
        firePropertyChange("year", oldYear, value);
        oldYear = value;
    }
705851
def add_years(datetime_like_object, n, return_date=False):
    
    a_datetime = parser.parse_datetime(datetime_like_object)

    # try assign year, month, day
    try:
        a_datetime = datetime(
            a_datetime.year + n, a_datetime.month, a_datetime.day,
            a_datetime.hour, a_datetime.minute, a_datetime.second,
            a_datetime.microsecond, tzinfo=a_datetime.tzinfo,
        )
    except ValueError:  # Must be xxxx-02-29
        a_datetime = datetime(
            a_datetime.year + n, 2, 28,
            a_datetime.hour, a_datetime.minute,
            a_datetime.second, a_datetime.microsecond)

    if return_date:  # pragma: no cover
        return a_datetime.date()
    else:
        return a_datetime
435784
private void appendDateTime(long epochMillis) {
        date.setTime(epochMillis);
        calendar.setTime(date);
        appendDate();
        write(' ');
        appendTime();
    }
907271
def datetime_to_year_quarter(dt):
    
    year = dt.year
    quarter = int(math.ceil(float(dt.month)/3))
    return (year, quarter)
991330
def after_epoch(self, epoch_data: EpochData, **kwargs) -> None:
        

        if self._after_epoch:
            self._check_nan(epoch_data)
98423
def move_datetime_year(dt, direction, num_shifts):
    
    delta = relativedelta(years=+num_shifts)
    return _move_datetime(dt, direction, delta)
977815
def set_year(self, year):
        
        self.year = YEARS.get(year, year)
        data = {'idCursus': self.year}
        soup = self.post_soup('/~etudiant/login.php', data=data)
        return bool(soup.select('ul.rMenu-hor'))
475717
def decyear2dt(t):
    
    year = int(t)
    rem = t - year 
    base = datetime(year, 1, 1)
    dt = base + timedelta(seconds=(base.replace(year=base.year+1) - base).total_seconds() * rem)
    #This works for np array input
    #year = t.astype(int)
    #rem = t - year 
    #base = np.array([datetime(y, 1, 1) for y in year])
    return dt
71227
def set_year(self, year):
        
        self._set_attr(TDRC(encoding=3, text=str(year)))