Java计算日期和时间差

 

用joda datetime的days.between即可。

 

 

  DateTime dt1 = new DateTime(d1);
            DateTime dt2 = new DateTime(d2);

            System.out.print("两个时间相差:");
            System.out.print(Days.daysBetween(dt1, dt2).getDays() + " 天, ");

 

refurl:http://www.blogjava.net/qiyadeng/archive/2013/02/19/395428.html

 

http://wandejun1012.iteye.com/admin/blogs/1746662

 

 

 

 

你可能感兴趣的:(java)