Calendar.getInstance().add(Calendar.DATE, -1).getTime();
报这个错:
Cannot invoke getTime() on the primitive type void
PHPz2017-04-18 09:58:00
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.DATE, -1);
long time = cal.getTime();
這樣寫就可以了。