Calendar.before() and Calendar.after() returning incorrect values
<p>I'm getting a bit stuck with date comparison in Java/Android</p>

<pre><code>            DateFormat df = new SimpleDateFormat("dd/MM/yy HH:mm");
                Calendar now = Calendar.getInstance();
                Calendar c;

                c = Calendar.getInstance();
                c.set(settings.getInt("year", 0), settings.getInt("month", 0), settings.getInt("day", 0), settings.getInt("hour", 0), settings.getInt("minute", 0));

                views.setTextViewText(R.id.textView4, String.valueOf(c.getTime().before(now.getTime())));
                views.setTextViewText(R.id.textView2, String.format("%s - %s", df.format(c.getTime()), df.format(now.getTime())));

                int timeout = 0;
                while( c.getTime().before(now.getTime()) )
                {
                    c.add(Calendar.SECOND, 30);
                    c.add(Calendar.MINUTE, 12);
                    c.add(Calendar.HOUR_OF_DAY, 6);
                    isHigh = 1 - isHigh;
                    timeout++;
                    if( timeout &gt;= 400 )
                        break;
                }
                views.setTextViewText(R.id.textView5, String.valueOf(c.getTime().before(now.getTime())));
                views.setTextViewText(R.id.textView3, String.format("%s - %s", df.format(c.getTime()), df.format(now.getTime())));
</code></pre>

<p>The idea of this is it takes a starting date from saved settings, and adds 6:12:30 to the clock until it passes the current time.</p>

<p>However, my textboxes give me the following:</p>

<blockquote>
  <p>false : 09/07/12 04:20 - 11/08/12 00:00</p>
  
  <p>false : 09/07/12 04:20 - 11/08/12 00:00</p>
</blockquote>

<p>Why is 9th July 2012 returning false when calling "before(11th Aug 2012)"?</p>

<p>If I change the ".before" to ".after", I get this:</p>

<blockquote>
  <p>true : 09/07/12 04:20 - 11/08/12 00:00</p>
  
  <p>true : 20/10/12 15:40 - 11/08/12 00:00</p>
</blockquote>

<p>Which doesn't seem to make any sense.</p>

<p>Any ideas what I'm doing wrong? Thanks</p>
