date difference in days, in Android

前端 未结 2 1781
伪装坚强ぢ
伪装坚强ぢ 2020-12-22 10:52

i have to find day difference between two date in android, i find the difference in days using timemilliseconds() but is there any other way to find difference?

tha

2条回答
  •  一生所求
    2020-12-22 11:25

    Date#compareTo(Date)

    see: http://developer.android.com/reference/java/util/Date.html

    or you could use http://developer.android.com/reference/java/util/Calendar.html if you need more details about the date difference, e.g http://developer.android.com/reference/java/util/GregorianCalendar.html

提交回复
热议问题