日期相减差得到天数

Posted 徘徊在人间的水墨

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了日期相减差得到天数相关的知识,希望对你有一定的参考价值。

//距离意向购车时间(不小于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);

以上是关于日期相减差得到天数的主要内容,如果未能解决你的问题,请参考以下文章