今、私はこのコードを使用しています
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE) - 1, 12, 0, 0); //Sets Calendar to "yeserday, 12am"
if(sdf.format(getDateFromLine(line)).equals(sdf.format(cal.getTime()))) //getDateFromLine() returns a Date Object that is always at 12pm
{...CODE
getdateFromLine()によって返される日付が昨日の日付であるかどうかを確認するためのよりスムーズな方法が必要です。重要なのは日付だけで、時間は重要ではありません。そのため、SimpleDateFormatを使用しました。よろしくお願いします!