LocalDate today = LocalDate.now();
LocalDate yesterday = today.minusDays(1);
// In string format
LocalDate today = LocalDate.now();
String yesterday = (today.minusDays(1)).format(DateTimeFormatter.ISO_DATE);
Date date = DateUtils.addDays(new Date(), -1);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
Instant now = Instant.now();
Instant yesterday = now.minus(1, ChronoUnit.DAYS);
System.out.println(now);
System.out.println(yesterday);