当前时间加指定的几个月

 private  String getPreMonth(String date) throws Exception {
        SimpleDateFormat dft = new SimpleDateFormat("yyyyMMddHHmmss");
        Date dt = dft.parse(date);
        Calendar rightNow = Calendar.getInstance();
        rightNow.setTime(dt);
        rightNow.add(Calendar.MONTH, appConfig.getCreditInvestigation());
        Date dt1 = rightNow.getTime();
        String reStr = dft.format(dt1);
        return reStr;
    }

 

posted @ 2021-12-22 14:09  我的博客我的人生  阅读(37)  评论(0编辑  收藏  举报