title: getting numbers day between two dates range include start date and end date
body: <p>How to get number of days between two dates range including start date and end date.
  The start date is stored t3 as 20140221 in string.
  The end date is stored t4 as 20140315 in string.
  How to get The number of days between these two dates in java and gwt.
  how to get range of dates with respective day between two given dates.</p>
  
  <p>for example:-</p>
  
  <p>from 10/10/2004 to 14/10/2004 range of dates are</p>
  
  <p>10/10/2004 sunday
  11/10/2004 monday
  12/10/2004 tuesday
  13/10/2004 wednesday
  14/10/2004 thursday</p>
  
  <p>/////////////////////////////////////////////////////////////////////////////////////////////////////</p>
  
  <pre><code>private ArrayList&lt;Date&gt; searchDatesBetween(Date stdate,Date endate)
  {
      ArrayList&lt;Date&gt; searchList=new ArrayList&lt;Date&gt;();
  Date begin=new Date(stdate.getTime());
  searchList.add(new Date(begin.getTime()));
  while(begin.compareTo(endate)&lt;0){           
  begin=new Date(begin.getTime()+864000);     
  searchList.add(new Date(begin.getTime()));
  }
  return searchList;
  }
  </code></pre>
  
  <blockquote>
    <p>Blockquote</p>
  </blockquote>
  
  <pre><code>void onButCreateRosterClick(ClickEvent event) {
      DateTimeFormat l_format = DateTimeFormat.getFormat("EEE-dd/MM/yyyy");   
      Date stdate=new Date();
      Date endate=new Date(); 
      dateList=new ArrayList&lt;Date&gt;();     
  
      stDateOfRoster=mRosterList.get(indexofdate).getT3();
      enDateOfRoster=mRosterList.get(indexofdate).getT4();
      codeOfShift=mShiftList.get(indexofshift).getT1();
      stdate=l_format.parse(stDateOfRoster);
      endate=l_format.parse(enDateOfRoster);
  
      dateList=searchDatesBetween(stdate,endate);
  }
  </code></pre>