得到日期相差天数

Timestamp startTime=Timestamp.valueOf(map.get("startTime").toString());
Timestamp endTime=Timestamp.valueOf(map.get("endTime").toString());
int buyDays = (int) (startTime.getTime() - endTime.getTime())/(24 * 60 * 60 * 1000);

你可能感兴趣的:(日期)