最简单的办法
  public static int getDutyDays( java.util.Date startDate,java.util.Date endDate ){
    int result = 0;
    java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd");
    while ( startDate.compareTo( endDate ) <= 0 ){
      if ( startDate.getDay() != 6 && startDate.getDay() != 0 )
        result ++;
      System.out.println( df.format(startDate)+":"+ startDate.getDay());      startDate.setDate(startDate.getDate() + 1);
    }    return result;
  }