現在の日付とデータベースから取得した日付を比較する際にいくつかの問題に直面しています。データベースから日付を取得し、このような日付変数に格納しました
String due_date_task = cursor.getString(cursor.getColumnIndex(dueDateOfTask));
SimpleDateFormat currentFormater = new SimpleDateFormat("dd/MM/yyyy");
Date date1 = currentFormater.parse(due_date_task);
今、私が欲しいのは、DataBase から取得した日付が CurrentDate と同等かどうかを確認することです。
Calendar currentDate = Calendar.getInstance();
Date date2 = currentDate.getTime();
if(date1.equals(date2))
System.out.println("今日のタスク");
このように確認したいだけです。よろしくお願いします