• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Date comparison

1

  • Comparison of Date

    Votes: 0 0.0%

  • Total voters
    1
  • Poll closed .

Dinesh14

Lurker
I'm facing some problems in comparing the current date and the date which is retrieved from Database.I just retrieved date from DataBase and Stored in a Date variable like this

String due_date_task=
cursor.getString(cursor.getColumnIndex(dueDateOfTask));

SimpleDateFormat currentFormater = new SimpleDateFormat("dd/MM/yyyy");
Date date1 = currentFormater.parse(due_date_task);
Now,what i want is should check whether date which is retrieved from DataBase is Equivalent to CurrentDate or not.

Calendar currentDate = Calendar.getInstance();
Date date2 = currentDate.getTime();

if(date1.equals(date2))
{
System.out.println(" Today Task "):
}
i just want to check like this.Thanks in advance
 
Hello and welcome to the forums - thanks for joining!

It sounds like you are talking about development... I can't help you, as I know nothing about that sort of thing.

You might like to check out Android Development - Android Forums, as this is where other devs hang out, who should be able to help you!

Hope you find this place useful!
 
Back
Top Bottom