title: How to get every day except weekend or Saturday or Sunday between two dates in java?
body: <p>hi all how to generate dates if the start date and end date are provided in java?</p>
  
  <p>like the following : </p>
  
  <p>Ex : if the <code>start date is 15-04-2012</code> and <code>end date is 15-06-2012</code> having this i want dates to be like the following and the list should omit <code>saturday</code> and <code>sunday</code></p>
  
  <p><code>1.15-04-2012,</code>
  <code>2.16-04-2012,</code>
  <code>3.17-04-2012,</code>
  <code>.</code>
  <code>.</code>
  <code>.</code>
  <code>.</code>
  <code>.</code>
  <code>.</code>
  <code>15-06-2012</code></p>
  
  <p>I have done like the following but it will generate for one month if the date range is of same month.
  `</p>
  
  <pre><code>public static ConcurrentHashMap&lt;String, String&gt; getWorkingDaysMap(int year, int month, int day){
          int totalworkingdays=0,noofdays=0;
          String nameofday = "";
          ConcurrentHashMap&lt;String,String&gt; workingDaysMap = new ConcurrentHashMap&lt;String,String&gt;();
          Map&lt;String,String&gt; holyDayMap = new LinkedHashMap&lt;String,String&gt;();
          noofdays = findNoOfDays(year,month,day);
  
          for (int i = 1; i &lt;= noofdays; i++) {
              Date date = (new GregorianCalendar(year,month - 1, i)).getTime(); // year,month,day
              SimpleDateFormat f = new SimpleDateFormat("EEEE");
              nameofday = f.format(date);
  
              String daystr="";
              String monthstr="";
  
              if(i&lt;10)daystr="0";
              if(month&lt;10)monthstr="0";
  
              String formatedDate = daystr+i+"/"+monthstr+month+"/"+year;
  
              if(!(nameofday.equals("Saturday") || nameofday.equals("Sunday"))){
                  workingDaysMap.put(formatedDate,formatedDate);
                  totalworkingdays++;
              }
          }
  
          return workingDaysMap;
      }
  </code></pre>
  
  <p>So please do advice me how to go about.</p>
  
  <p>Regards
  Tony</p>