public static IEnumerable <ZonedDateTime> FromDuration(ZonedDateTime start, ZonedDateTime end, Duration duration) { Ensure.Bool.IsTrue(start.ToInstant() < end.ToInstant()); var range = new ZonedDateTimeRange(start, end); return(FromDuration(range, duration)); }
public static IEnumerable <ZonedDateTime> FromDuration(ZonedDateTimeRange range, Duration duration) { var c = range.Start; var e = range.End; while (ZonedDateTime.Comparer.Instant.Compare(c, e) < 0) { yield return(c); c = c.Plus(duration); } }
public static IEnumerable <Instant> HourlyUtc(ZonedDateTimeRange range) { Instant c = range.Start.ToInstant(); Instant e = range.End.ToInstant(); while (c < e) { yield return(c); c = c.Plus(Duration.FromHours(1)); } }
public static IEnumerable <ZonedDateTime> Hourly(ZonedDateTimeRange range) { return(FromDuration(range, Duration.FromHours(1))); }