title: getMonth getYear getDate giving errorneous result
body: <p>I have a method to calculate the expiry date given manufacturing date of format("yyyy-MM-dd") and the months before the product could be used in int.First I tried with getYear getMonth getDate of Month class as follows I dint got errors results:</p>
  
  <pre><code>public void calculateExpiryDate(List&lt;Item&gt; items)
      {
          Iterator&lt;Item&gt; itr=items.iterator();
          while(itr.hasNext())
          {
              Item i=itr.next();
              Date md=i.getManufacturingDate();
              int ubm=i.getUseBeforeMonths();
              Calendar c=new GregorianCalendar(md.getYear(),md.getMonth(),md.getDate());
              //System.out.println(c);
              c.add(Calendar.MONTH, ubm);
              Date exp=c.getTime();
              i.setExpiryDate(exp);
              SimpleDateFormat sdf=new SimpleDateFormat("yyyy MM dd");
              System.out.println(md+" "+ubm+" "+sdf.format(exp)+"  "+" "+i.getId());
          }
      }
  </code></pre>
  
  <p>But when I Quit using it and used setTime instead it solved my problem.I want to know what mistake I was making before and why things don't work that day and if any mistake(cause I was not getting any compile time errors) what is it actually.Following is the version of same code giving proper results.</p>
  
  <pre><code>public void calculateExpiryDate(List&lt;Item&gt; items)
      {
          Iterator&lt;Item&gt; itr=items.iterator();
          while(itr.hasNext())
          {
              Item i=itr.next();
              Date md=i.getManufacturingDate();
              int ubm=i.getUseBeforeMonths();
              Calendar c=new GregorianCalendar();
              c.setTime(md);
              //System.out.println(c);
              c.add(Calendar.MONTH, ubm);
              Date exp=c.getTime();
              i.setExpiryDate(exp);
              SimpleDateFormat sdf=new SimpleDateFormat("yyyy MM dd");
              System.out.println(md+" "+ubm+" "+sdf.format(exp)+"  "+" "+i.getId());
          }
      }
  </code></pre>