Android: Comparing getDat() with current Date
<p>I have this CalendarView below</p>

<p><img src="http://i.stack.imgur.com/bq5IS.png" alt="enter image description here"></p>

<p>and if i click that day which is the Date today it will popup a dialog.. but this Calendar wont popup if u clicked a date before the CurrentDate it will just say u can't add event before the current day/time.. and is running well if i click any day after the date today, but when i click the date today i will say a message just like when i click the date before it... </p>

<p>Here is my Code for comparing dates</p>

<pre><code>long currentTime;
Date curr = new Date();
currentTime = curr.getTime();
if(cw.getDate() &gt;= currentTime || formatDate(cw.getDate()) == formatDate(currentTime))
{
            Dialog d = new Dialog(ScheduleActivity.this);
            //some code for setting up the dialog
            d.show();

}
else
{
        Toast toast = Toast.makeText(ScheduleActivity.this, Long.toString(cw.getDate())+" || "+Long.toString(currentTime),10000);
        toast.show();

        Log.d("timecheck", formatDate(cw.getDate())+" || "+ formatDate(currentTime));
}
</code></pre>

<p>I just used that formatDate with a Format of MM/dd/yyyy just to compare the two dates cuz comparing the time stamp alone still does not work (using ">=" )</p>

<p>Btw the toast are changed so i can see what values are being compared... in Milliseconds they are defferent really but when i format it to MM/dd/yy supposed to be it will see it as the same... but it wont go through the if part it'll go to the else part.. i Logged the formattedDate in the logcat, logcat below..</p>

<p>Logcat Logs
<img src="http://i.stack.imgur.com/VGhNG.png" alt="enter image description here"></p>
