title: Iterate over dates range (the scala way)
body: <p>Given a start and an end date I would like to iterate on it by day using a foreach, map or similar function. Something like</p>
  
  <pre><code>(DateTime.now to DateTime.now + 5.day by 1.day).foreach(println)
  </code></pre>
  
  <p>I am using <a href="https://github.com/nscala-time/nscala-time" rel="noreferrer">https://github.com/nscala-time/nscala-time</a>, but I get returned a joda Interval object if I use the syntax above, which I suspect is also not a range of dates, but a sort of range of milliseconds. </p>
  
  <p>EDIT: The question is obsolete. As advised on the <a href="http://www.joda.org/joda-time/" rel="noreferrer">joda</a> homepage, if you are using java 8 you should start with or migrate to <a href="https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html" rel="noreferrer">java.time</a>.</p>