common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java
public static String getNextDay(String nowDate, int delay) {
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            String mdate = "";
            Date d = strToDate(nowDate);
            long myTime = (d.getTime() / 1000) + delay * 24 * 60 * 60;
            d.setTime(myTime * 1000);
            mdate = format.format(d);
            return mdate;
        } catch (Exception e) {
            return "";
        }
    }
public static String getNextDay(String nowDate, int delay) {
        try {
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            String mdate = "";
            Date d = strToDate(nowDate);
            long myTime = (d.getTime() / 1000) + delay * 24 * 60 * 60;
            d.setTime(myTime * 1000);
            mdate = format.format(d);
            return mdate;
        } catch (Exception e) {
            return "";
        }
    }
public static String getNextDay ( String nowDate , int delay ) { try { SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd" ) ; String mdate = "" ; Date d = strToDate ( nowDate ) ; long myTime = ( d . getTime ( ) / 1000 ) + delay * 24 * 60 * 60 ; d . setTime ( myTime * 1000 ) ; mdate = format . format ( d ) ; return mdate ; } catch ( Exception e ) { return "" ; } }
得到一个时间延后或前移几天的时间,nowdate为时间,delay为前移或后延的天数
得到一个时间延后或前移几天的时间 nowdate为时间 delay为前移或后延的天数