title: Set day of month in calendar android
body: <p>I'm not a frequent programmer for android and do not really understand why this happens:</p>
  
  <pre><code>Calendar c = Calendar.getInstance();
      c.set(Calendar.YEAR, anio);
      c.set(Calendar.MONTH, mes);
      c.set(Calendar.DAY_OF_MONTH, dia);
      c.set(Calendar.HOUR, hora);
      c.set(Calendar.MINUTE, minuto);
      c.set(Calendar.SECOND, 0);
      c.set(Calendar.MILLISECOND, 0); 
      Log.i("ET", "Day: " +  dia );
      Log.i("ET", "CalDAy: " +  c.get(Calendar.DAY_OF_MONTH));
      SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy hh:mm");
      Log.i("ETCalendar", "Tactual "+ formatter.format(c.getTimeInMillis()));
      return c.getTimeInMillis();
  </code></pre>
  
  <p>This is the LogCat:</p>
  
  <pre><code>I/ET(27819): Day: 16 11-16 19:13:38.656: 
  I/ET(27819): CalDAy: 17 11-16 19:13:38.656: 
  I/ETCalendar(27819): 4Tactual 17/11/2013 07:13
  </code></pre>
  
  <p>A possible solution that comes to mind is: </p>
  
  <pre><code>c.set(Calendar.DAY_OF_MONTH, dia - 1);
  </code></pre>
  
  <p>but would that work?</p>
  
  <p>Thanks!</p>