我有一个应用程序,必须在N天内显示用户使用我们的应用程序。如何实现这种情况?
代码:
startDateValue = new Date("29/07/2017");
endDateValue = new Date("30/07/2017");
long diff = endDateValue.getTime() - startDateValue.getTime();
long seconds = diff / 1000;
long minutes = seconds / 60;
long hours = minutes / 60;
long days = (hours / 24) + 1;
Log.d("days", "" + days);