java create date object from yesterday

Solutions on MaxInterview for java create date object from yesterday by the best coders in the world

showing results for - "java create date object from yesterday"
George
13 Jan 2020
1Date date = DateUtils.addDays(new Date(), -1);
2SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
3return sdf.format(date);
4