根据天数计算时间

//计算采购日期
            SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
            Calendar c = Calendar.getInstance();
            c.add(Calendar.DAY_OF_MONTH, Integer.parseInt(toPurchaseDays));//采购周期
            String purChaseDate = sf.format(c.getTime());//采购时间
            DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            Date date = null;
            try {
                date = format.parse(purChaseDate);
            } catch (ParseException e2) {
                e2.printStackTrace();
            }

posted @ 2017-09-15 18:24  徘徊在人间的水墨  阅读(217)  评论(0编辑  收藏  举报