删除掉早于一定时间的记录
@param baseTime			从什么时间算起
@param periodBefore		多少时间之前的要删掉
@param unit				时间单位
329918
public void purge(long baseTime, long periodBefore, TimeUnit unit) {
		purge(baseTime - TimeUnit.MILLISECONDS.convert(periodBefore, unit));
	}
284080
public void setBaselineDate(int baselineNumber, Date value)
   {
      set(selectField(ProjectFieldLists.BASELINE_DATES, baselineNumber), value);
   }
1283579
public void setTimecodeBase(int timecodeBase)
    {
        if (timecodeBase < 0) {
            timecodeBase = 0;
        }

        if (this.timecodeBase > 0 && timecodeBase != this.timecodeBase) {
            this.frames = (int) Math.round((double) this.frames * timecodeBase / this.timecodeBase);
        }
        this.timecodeBase = timecodeBase;

        innerSetDropFrame(this.dropFrame);
    }
300721
@Override
    public long get(TemporalUnit unit) {
        if (unit == ChronoUnit.YEARS) {
            return years;
        } else if (unit == ChronoUnit.MONTHS) {
            return months;
        } else if (unit == ChronoUnit.DAYS) {
            return days;
        } else {
            throw new UnsupportedTemporalTypeException("Unsupported unit: " + unit);
        }
    }
1211938
public static Timer newTimer(String name, TimeUnit unit) {
    return new BasicTimer(MonitorConfig.builder(name).build(), unit);
  }
411557
public void purge(long periodBefore, TimeUnit unit) {
		purge(System.currentTimeMillis() - TimeUnit.MILLISECONDS.convert(periodBefore, unit));
	}
688241
public void modifyTimeBase(){
		String [] time_grid=new String[6];
		time_grid=normalizer.getTimeBase().split("-");
		
		String s = "";
		if(_tp.tunit[0] != -1)
			s += Integer.toString(_tp.tunit[0]);
		else
			s += time_grid[0];
		for(int i = 1; i < 6; i++){
			s += "-";
			if(_tp.tunit[i] != -1)
				s += Integer.toString(_tp.tunit[i]);
			else
				s += time_grid[i];
		}
		normalizer.setTimeBase(s);
	}
323344
public void setTimeUnit(com.google.api.ads.admanager.axis.v201808.TimeUnit timeUnit) {
        this.timeUnit = timeUnit;
    }
1002713
public static long generateInitialBaseTime(long initializeTime, int intarval,
            TimeUnit intervalUnit) throws ParseException
    {
        // １つ大きな単位をベースに基準時刻を取得する。
        // 例：10分間隔をインターバルとし、8:35を起動時刻とした場合、8:00を基準時刻とする。
        long datumTime = generateDatumTime(initializeTime, intervalUnit);

        // 基準時刻から初期生成ファイル名称用の日時を算出する。
        // 例：10分間隔をインターバルとし、8:35を起動時刻とした場合、8:00を基準時刻とし、
        //    そこから8:10、8:20・・・とずらしていって初期生成ファイル名称用の日時(8:30)を算出する。
        long initialBaseTime = generateNextFileBaseTime(initializeTime, datumTime, intarval,
                intervalUnit);

        return initialBaseTime;
    }
1144114
public void setTime(Date minTime, Date maxTime) throws IllegalArgumentException {
        if (minTime != null && maxTime != null && minTime.after(maxTime)) {
            throw new IllegalArgumentException("Value of the minTime parameter should specify time before the time specified by the value of the maxTime parameter");
        }
        this.minTime = minTime;
        this.maxTime = maxTime;
    }
669161
public static long between(Date beginDate, Date endDate, DateUnit unit) {
		return between(beginDate, endDate, unit, true);
	}
919464
public void setTimeRange(String fieldName, Date startTime, Date endTime) {
		this.where += " and " + fieldName + ">=? and " + fieldName + "<=?";
		this.getParam().setDate(startTime);
		this.getParam().setDate(endTime);
	}
159704
public long between(DateUnit unit) {
		long diff = end.getTime() - begin.getTime();
		return diff / unit.getMillis();
	}
719633
def set_unit(self, unit):
        
        # accept all core time units
        if unit is None or (isinstance(unit, units.NamedUnit) and
                            unit.physical_type == 'time'):
            self._unit = unit
            return
        # convert float to custom unit in seconds
        if isinstance(unit, Number):
            unit = units.Unit(unit * units.second)
        # otherwise, should be able to convert to a time unit
        try:
            unit = units.Unit(unit)
        except ValueError as exc:
            # catch annoying plurals
            try:
                unit = units.Unit(str(unit).rstrip('s'))
            except ValueError:
                raise exc
        # decompose and check that it's actually a time unit
        dec = unit.decompose()
        if dec.bases != [units.second]:
            raise ValueError("Cannot set GPS unit to %s" % unit)
        # check equivalent units
        for other in TIME_UNITS:
            if other.decompose().scale == dec.scale:
                self._unit = other
                return
        raise ValueError("Unrecognised unit: %s" % unit)
834265
public static long timeUnitToMillis(long value,
                                        TimeUnit unit,
                                        boolean annotation,
                                        BeanMetaData bmd) throws EJBConfigurationException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(tc, "timeUnitToMillis: " + value + unit);
        }

        // Initialize to input value in case current unit is already in
        // javax.util.concurrent.TimeUnit.MILLISECONDS
        long timeout = value;

        if (timeout > 0) {

            timeout = TimeUnit.MILLISECONDS.convert(value, unit);
            if (timeout == Long.MAX_VALUE || timeout == Long.MIN_VALUE) {
                Tr.error(tc, "STATEFUL_TIMEOUT_OVERFLOW_CNTR0309E",
                         new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(),
                                       bmd.getModuleMetaData().getApplicationMetaData().getName(),
                                       value, unit });
                throw new EJBConfigurationException("Conversion of stateful session timeout value of " +
                                                    value + " " + unit + " to milliseconds resulted in overflow.");
            }

        }
        else {
            if (timeout == 0) {
                // 0 means no wait, represented internally as the nominal 1 millisecond
                timeout = 1;
            }
            else if (timeout == -1) {
                // -1 indicates wait forever, represented internally as 0
                timeout = 0L;
            }
            else {

                // invalid (negative) timeout value
                Object[] parms = new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(), bmd.getModuleMetaData().getApplicationMetaData().getName(), timeout };
                if (annotation) {
                    Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_ANN_CNTR0311E", parms);
                }
                else {
                    Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_XML_CNTR0312E", parms);
                }

                throw new EJBConfigurationException("Stateful session timeout value of " +
                                                    value + " " + unit + " is negative.");

            }
        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(tc, "timeUnitToMillis: " + timeout);
        }

        return timeout;
    }
900379
protected Date getTimeBefore (final Date eTime)
  {
    return (m_aCronEx == null) ? null : m_aCronEx.getTimeBefore (eTime);
  }
1091501
@Override
    public Configuration defaultInterval(long time, TimeUnit unit) {
        return defaultInterval(new Duration(time, unit));
    }