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();
Just write it like this.
ringa_lee2017-04-18 09:58:00
Calendar.getInstance().add(Calendar.DATE, -1)
This sentence returns void