String registerTime=“2017-06-05”;
Calendar c = Calendar.getInstance();
Date date = null;try {
date = new SimpleDateFormat("yy-MM-dd").parse(registerTime);
} catch (ParseException e) {
e.printStackTrace();
}
c.setTime(date);
int day=c.get(Calendar.DATE);
c.set(Calendar.DATE,day-1);
String lastregisterTime = new SimpleDateFormat("yyyy-MM-dd").format(c.getTime());
System.out.println(lastregisterTime);