java.time
The java.time API introduced with Java-8 (March 2014) supplants the error-prone and outdated java.util and their formatting API, SimpleDateFormat. It is recommended to stop using the legacy date-time API and switch to the modern date-time API.
How to parse a date string using java.time API?
Use LocalDate#parse(CharSequence text, DateTimeFormatter formatter) to parse a date string which is not in ISO 8601 format. However, a date string already in ISO 8601 format (yyyy-MM-dd), can be parsed using LocalDate parse(CharSequence text).
Demo:
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
public class Main {
    public static void main(String[] args) {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("M/d/u", Locale.ENGLISH);
        String strDateTime = "3/1/2009";
        LocalDate date = LocalDate.parse(strDateTime, formatter);
        System.out.println(date);
        strDateTime = "2009-03-01";
        date = LocalDate.parse(strDateTime);
        System.out.println(date);
    }
}
Output:
2009-03-01
2009-03-01
How to get the previous date using java.time API?
The simplest option is to use LocalDate#minusDays. You can use one of the overloaded LocalDate#minus functions as well but they are there mainly to subtract for other time units e.g. hour, minute etc.
Demo:
import java.time.LocalDate;
import java.time.Period;
import java.time.temporal.ChronoUnit;
public class Main {
    public static void main(String[] args) {
        LocalDate today = LocalDate.now();
        System.out.println(today);
        LocalDate previousDay = today.minusDays(1);
        System.out.println(previousDay);
        // Alternatively
        previousDay = today.minus(Period.ofDays(1));
        System.out.println(previousDay);
        // Alternatively
        previousDay = today.minus(1, ChronoUnit.DAYS);
        System.out.println(previousDay);
    }
}
Output:
2022-10-13
2022-10-12
2022-10-12
2022-10-12
Putting together:
LocalDate previousDay = LocalDate.parse(
                            "3/1/2009", 
                            DateTimeFormatter.ofPattern("M/d/u", Locale.ENGLISH)
                        ).minusDays(1); // 2009-02-28
Just in case
Just in case, you want the result to be formatted in the same format as the date string, use DateTimeFormatter#format e.g.
DateTimeFormatter formatter= DateTimeFormatter.ofPattern("M/d/u", Locale.ENGLISH);
System.out.println(previousDay.format(formatter)); // 2/28/2009
// Alternatively
System.out.println(formatter.format(previousDay)); // 2/28/2009
Learn more about the the modern date-time API from Trail: Date Time.
Some useful links:
- Never use Date-Time formatting/parsing API without a Locale
- I prefer u to y with DateTimeFormatter.