common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java
public static String getPreTime(String sj1, String jj) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String mydate1 = "";
        try {
            Date date1 = format.parse(sj1);
            long Time = (date1.getTime() / 1000) + Integer.parseInt(jj) * 60;
            date1.setTime(Time * 1000);
            mydate1 = format.format(date1);
        } catch (Exception e) {
        }
        return mydate1;
    }
public static String getPreTime(String sj1, String jj) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String mydate1 = "";
        try {
            Date date1 = format.parse(sj1);
            long Time = (date1.getTime() / 1000) + Integer.parseInt(jj) * 60;
            date1.setTime(Time * 1000);
            mydate1 = format.format(date1);
        } catch (Exception e) {
        }
        return mydate1;
    }
public static String getPreTime ( String sj1 , String jj ) { SimpleDateFormat format = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; String mydate1 = "" ; try { Date date1 = format . parse ( sj1 ) ; long Time = ( date1 . getTime ( ) / 1000 ) + Integer . parseInt ( jj ) * 60 ; date1 . setTime ( Time * 1000 ) ; mydate1 = format . format ( date1 ) ; } catch ( Exception e ) { } return mydate1 ; }
时间前推或后推分钟,其中JJ表示分钟.
时间前推或后推分钟 其中JJ表示分钟 .