title: android - why is current time less than a back date time in Calendar
body: <p>Date time set in calendar is '2016-6-18 13:54:00 ' and current date time is '2016-6-18 14:45:00' i.e. 2016-6-18 2:45 PM. In the calendar I set the <code>MONTH</code> value to be 5 as month is zero-based there. This is in android :</p>
  
  <pre><code>        Calendar calendar = Calendar.getInstance();
  
          calendar.set(Calendar.YEAR, 2016);
          calendar.set(Calendar.MONTH, 5);
          calendar.set(Calendar.DATE, 18);
          calendar.set(Calendar.HOUR_OF_DAY,13);
          calendar.set(Calendar.MINUTE,54);
          calendar.set(Calendar.SECOND,0);
  
          long alarmTime =calendar.getTimeInMillis();
          alarmTime = TimeUnit.MILLISECONDS.toSeconds(alarmTime);        
  
          long timeMillis = System.currentTimeMillis();
          long currentTimeSeconds =TimeUnit.MILLISECONDS.toSeconds(timeMillis);
  
          if (alarmTime &gt; currentTimeSeconds) {
  
             Toast.makeText(context, "Alarm is set", Toast.LENGTH_SHORT).show();
  
          }else{
  
            Toast.makeText(context, "Alarm is not set",  Toast.LENGTH_SHORT).show();
               }
  </code></pre>
  
  <p>But the result shows the toast "Alarm is set" whereas I expected the otherwise i.e. "Alarm is not set".</p>
  
  <p>What is going on here ?</p>
  
  <p><strong>EDIT:</strong>  To my surprise, the <a href="https://www.genymotion.com/" rel="nofollow">Genymotion</a> emulator shows 'Alarm is set' while the real device shows 'Alarm is not set'.  Why is this difference ?</p>