我写了这段代码来检查给定的日期是在10天之内还是10天之外,但AlarmManager.INTERVAL_DAY总是给0。如何在android或java中检查给定日期是否在10天内?
long lastdate=1535826537767
if ((System.currentTimeMillis() - lastdate) < (AlarmManager.INTERVAL_DAY * 10)) {
Log.d("Status", "Date within 10 days")
} else {
Log.d("Status", "Date within 10 days")
}
发布于 2018-09-05 02:38:52
简单地说:
long ten_days_in_in_millis = 864000000;
if ((System.currentTimeMillis() - lastdate) < ten_days_in_in_millis) {..
https://stackoverflow.com/questions/52172191
复制相似问题