public SimpleInterval(DateTime startTime, TimeSpan interval, DateTime endTime) { _startTime = startTime.RoundToSqlDateTime(); _interval = interval; _endTime = endTime.RoundToSqlDateTime(); }
private DateTime NextRunTimeInternal(DateTime time, bool includeStartTime) { var _time = time.RoundToSqlDateTime(); var span = _time - this.StartTime; if (this.Interval <= TimeSpan.Zero || span < TimeSpan.Zero) return this.StartTime; if (span.Ticks % this.Interval.Ticks == 0) return includeStartTime ? _time : _time + this.Interval; return _time + (this.Interval - span); }
public SimpleInterval(DateTime startTime, TimeSpan interval, int count) { _startTime = startTime.RoundToSqlDateTime(); _interval = interval; _endTime = _startTime + TimeSpan.FromTicks(_interval.Ticks * count); }