Useful for scheduling jobs checking every minute on the minute if an event should be triggered.
@param time
@param intervalInMinutes
@param offsetInMinutes

@return true if an interval starts this minute local time
423832
public static boolean isWithinMinuteOfIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
	
		time += LOCAL_UTC_OFFSET;
		long interval = MINUTE_IN_MS * intervalInMinutes;
		long offset = calculateOffsetInMs(intervalInMinutes, offsetInMinutes);
	
		return (interval * ((time + HALF_MINUTE_IN_MS) / interval)) + offset
				== roundToMinute(time);
	}
1331236
public boolean containsInterval(Interval<T> i) {

        for (Interval<T> item : intervals) {
            if (item.contains(i)) {
                return true;
            }
        }

        return false;
    }
646260
public void setStart(ReadableInstant start) {
        long startMillis = DateTimeUtils.getInstantMillis(start);
        super.setInterval(startMillis, getEndMillis(), getChronology());
    }
1025892
public static function check(int $offsetHour) : void
    {
        if ($offsetHour < -18 || $offsetHour > 18) {
            throw DateTimeException::fieldNotInRange(self::NAME, $offsetHour, -18, 18);
        }
    }
29621
public void setInterval(ReadableInterval interval) {
        if (interval == null) {
            throw new IllegalArgumentException("Interval must not be null");
        }
        long startMillis = interval.getStartMillis();
        long endMillis = interval.getEndMillis();
        Chronology chrono = interval.getChronology();
        super.setInterval(startMillis, endMillis, chrono);
    }
165595
public void setTimePicker(final TimePicker timePicker, final int hour, final int minute) {
		if(timePicker != null){
			Activity activity = activityUtils.getCurrentActivity(false);
			if(activity != null){
				activity.runOnUiThread(new Runnable()
				{
					public void run()
					{
						try{
							timePicker.setCurrentHour(hour);
							timePicker.setCurrentMinute(minute);
						}catch (Exception ignored){}
					}
				});
			}
		}
	}
909976
public static long getNextIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
		long interval = MINUTE_IN_MS * intervalInMinutes;
		return getPreviousIntervalStart(time, intervalInMinutes, offsetInMinutes) + interval;
	}
882000
public boolean contains(ChronoInterval<T> interval) {

        for (ChronoInterval<T> i : this.intervals) {
            if (i.equals(interval)) {
                return true;
            }
        }

        return false;

    }
743500
public void setInterval(Interval interval) {
        if (interval == null) {
            interval = INTERVAL_FACTORY.getInstance();
        }
        this.interval = interval;
    }
879127
@SuppressWarnings("unchecked")
  public static void registerTopologyTimerEvents(Map<String, Object> conf,
                                                 String name, Duration interval,
                                                 Runnable task) {
    if (interval.isZero() || interval.isNegative()) {
      throw new IllegalArgumentException("Timer duration needs to be positive");
    }
    if (!conf.containsKey(Config.TOPOLOGY_TIMER_EVENTS)) {
      conf.put(Config.TOPOLOGY_TIMER_EVENTS, new HashMap<String, Pair<Duration, Runnable>>());
    }

    Map<String, Pair<Duration, Runnable>> timers
        = (Map<String, Pair<Duration, Runnable>>) conf.get(Config.TOPOLOGY_TIMER_EVENTS);

    if (timers.containsKey(name)) {
      throw new IllegalArgumentException("Timer with name " + name + " already exists");
    }
    timers.put(name, Pair.of(interval, task));
  }
278914
@Override
  public void setStartTime(Date startTime) {

    if (startTime == null) {
      throw new IllegalArgumentException("Start time cannot be null");
    }

    Date eTime = getEndTime();
    if (eTime != null && startTime != null && eTime.before(startTime)) {
      throw new IllegalArgumentException("End time cannot be before start time");
    }

    this.startTime = startTime;
  }
1236974
public void setInterval(ReadableInstant start, ReadableInstant end) {
        if (start == null && end == null) {
            long now = DateTimeUtils.currentTimeMillis();
            setInterval(now, now);
        } else {
            long startMillis = DateTimeUtils.getInstantMillis(start);
            long endMillis = DateTimeUtils.getInstantMillis(end);
            Chronology chrono = DateTimeUtils.getInstantChronology(start);
            super.setInterval(startMillis, endMillis, chrono);
        }
    }
1287808
@Override
  public boolean isTimeIncluded (final long timeInMillis)
  {
    if ((getBaseCalendar () != null) && (getBaseCalendar ().isTimeIncluded (timeInMillis) == false))
    {
      return false;
    }

    final long startOfDayInMillis = getStartOfDayJavaCalendar (timeInMillis).getTime ().getTime ();
    final long endOfDayInMillis = getEndOfDayJavaCalendar (timeInMillis).getTime ().getTime ();
    final long timeRangeStartingTimeInMillis = getTimeRangeStartingTimeInMillis (timeInMillis);
    final long timeRangeEndingTimeInMillis = getTimeRangeEndingTimeInMillis (timeInMillis);
    if (!m_bInvertTimeRange)
    {
      return ((timeInMillis > startOfDayInMillis && timeInMillis < timeRangeStartingTimeInMillis) ||
              (timeInMillis > timeRangeEndingTimeInMillis && timeInMillis < endOfDayInMillis));
    }
    return ((timeInMillis >= timeRangeStartingTimeInMillis) && (timeInMillis <= timeRangeEndingTimeInMillis));
  }
1123159
private void updateInterval() {
        intervalMillis = getCombinedValue(endDate, endTime) - getCombinedValue(startDate, startTime);
        
        // if this is zero, most likely the times aren't set and the
        // dates are the same. in this case we don't really want a
        // zero interval. if we *really* want a zero interval, the
        // default would be zero so this is safe.
        if (intervalMillis == 0) {
            intervalMillis = defaultIntervalMillis;
        }
    }
430495
public static function check(int $offsetSeconds) : void
    {
        if ($offsetSeconds < -self::MAX_SECONDS || $offsetSeconds > self::MAX_SECONDS) {
            throw DateTimeException::fieldNotInRange(self::NAME, $offsetSeconds, -self::MAX_SECONDS, self::MAX_SECONDS);
        }
    }
1130341
public synchronized boolean startMonitor() {
        if (this.executor != null) {
            if (this.monitorHandle == null) {
                this.monitorHandle = this.executor.scheduleWithFixedDelay(this.monitor, this.monitorInterval, this.monitorInterval, TimeUnit.MILLISECONDS);
            }
            return true;
        }
        return false;
    }
1126705
public void setStart(final LocalTime START) {
        if (null == start) {
            _start = START;
        } else {
            start.set(START);
        }
    }