求代码
谢谢

解决方案 »

  1.   

    没有,因为 Java 不知道哪天是工作日,周六周日是固定的还是,
    但它不可能知道春节、清明、劳动、端午、中秋、国庆的休息天数。
      

  2.   

      如果你的工作时间是固定的
    SimpleDateFormat myFormat=new SimpleDateFormat("yyyy-MM-dd");
    Calendar cal = Calendar.getInstance();

    //当前日期后7天的日期
    cal.add(Calendar.DATE, 7);
      

  3.   

    If you decide days from Monday to Friday are working days, then you can make sure each week includes five working days. Right? So after n working days later, you can calculate the number of weeks: n/5, and the rest day is n%5. So in this case, you can get the date.
      

  4.   


    /**
     * 获取当前日期n天后的日期
     * @param n:返回当前天后的第N天
     * @return 返回的日期
     */
    public Date getAfterDate(int n){
      Calendar c = Calendar.getInstance();
      c.add(Calendar.DAY_OF_MONTH, n);
      return c.getTime();
    }