得到当前的时间 Date date = new Date();如果要计算 2个时间的差 比如 2012-12-21 离 现在还有多少天 ?long a = date.getTime();SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");long b = sdf.parse("2012-12-21").getTime();int success = (int) ((b-a)/(1000*60*60*24));//1000毫秒*60分钟*60秒*24小时 = 天System.out.println("距离2012-12-21还有"+success+"天");...