Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
String yesterday = new SimpleDateFormat( "yyyy-MM-dd ").format(cal.getTime());
System.out.println(yesterday);
时间: 2024-10-09 15:10:31
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
String yesterday = new SimpleDateFormat( "yyyy-MM-dd ").format(cal.getTime());
System.out.println(yesterday);