Yes.
Something like that:
DateTime now = DateTime.now(); DateTime start = now; DateTime stop = now.plusDays(10); DateTime inter = start; // Loop through each day in the span while (inter.compareTo(stop) < 0) { System.out.println(inter); // Go to next inter = inter.plusDays(1); }
In addition, here is the implementation for Clojure clj-time:
(defn date-interval ([start end] (date-interval start end [])) ([start end interval] (if (time/after? start end) interval (recur (time/plus start (time/days 1)) end (concat interval [start])))))
Oskar Kjellin
source share