title: Java: List the dates between a start and end date
body: <p>I'm trying to enter a start date, an end date, and obtain all the dates in between. I have the formatting where I need it, I have <a href="http://www.joda.org/joda-time/" rel="nofollow">Joda-Time</a> ready to go, but...past that, I'm stuck. I've included what I have working, as well as what is not going. </p>
  
  <p>So far, I have the following code (working):</p>
  
  <pre><code>DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
  DateFormat sysDate = new SimpleDateFormat("ddMMyyyy");
  
  //Get Start Date
  Date str_date = jXDatePicker1.getDate();
  jXDatePicker1.setFormats(dateFormat);
  String startDate = sysDate.format(jXDatePicker1.getDate());
  
  //Get End Date
  Date end_date = jXDatePicker2.getDate();
  jXDatePicker2.setFormats(dateFormat);
  String endDate = sysDate.format(jXDatePicker2.getDate());
  </code></pre>
  
  <p>And here's what I'm trying to implement but to no success:</p>
  
  <pre><code>List&lt;LocalDate&gt; dates = new ArrayList&lt;LocalDate&gt;();
  int days = Days.daysBetween(startDate, endDate).getDays();
  for (int i=0; i &lt; days; i++) {
      LocalDate d = startDate.withFieldAdded(DurationFieldType.days(), i);
      dates.add(d);
  }
  </code></pre>
  
  <p>Thank you in advance. </p>