Calendar nowDate=Calendar.getInstance();
Calendar oldDate=Calendar.getInstance();
nowDate.setTime(new Date());//设置为当前系统时间
oldDate.setTime(old);//设置为想要比较的日期
Long timeNow=nowDate.getTimeInMillis();
Long timeOld=oldDate.getTimeInMillis();
Long time = (timeNow-timeOld);//相差毫秒数