日期相减差得到天数

//距离意向购车时间(不小于0)
                            SimpleDateFormat format = new  SimpleDateFormat("yyyy-MM-dd");
                            Date nowDate= new Date();
                            Date beginDate= format.parse(format.format(nowDate));   
                            Date endDate= format.parse(qs.getString(i+1, "PURCHASE_DATE"));    
                            long day=(endDate.getTime()-beginDate.getTime())/(24*60*60*1000);

原文地址:https://www.cnblogs.com/Linger-wj/p/7527798.html