美文网首页
Android Joda-Time使用日期比较

Android Joda-Time使用日期比较

作者: hao_developer | 来源:发表于2020-06-18 19:05 被阅读0次

计算两个日期相差多久

根据需要来获取天数、小时 等
DateTime d1  = new DateTime("2004-03-26 13:31:40");
DateTime d2  = new DateTime("2004-03-26 13:31:40");
int lastDay = Days.daysBetween(d1 , d2 ).getDays();

使用方法:

dependencies {
compile 'net.danlew:android.joda:2.9.5'
}

转自:https://www.jianshu.com/p/92a131fa9dd5

相关文章

网友评论

      本文标题:Android Joda-Time使用日期比较

      本文链接:https://www.haomeiwen.com/subject/nlcpxktx.html