GregorianCalendar's method: add(int field, int amount) is giving unexpected results
<p>From the API I see:</p>

<blockquote>
  <p>Adds the specified (signed) amount of time to the given calendar
  field, based on the calendar's rules.</p>
</blockquote>

<p>There is a description of <em>Add rule 1 and Add rule 2</em>. I am incrementing by using
<code>date.add(Calendar.DAY_OF_MONTH, INCREMENT_BY_ONE)</code> where <code>INCREMENT_BY_ONE</code> is a constant set to <code>1</code> and all values less than day are set to zero. Rule 1 is what applies to me if I understand it correctly.</p>

<p>In this case I am starting the Gregorian calendar at <strong>March 1, 2012</strong></p>

<pre><code>GregorianCalendar date = new GregorianCalendar();
date.set(this.getStart().getYear(), this.getStart().getMonth(), 
               this.getStart().getDay(), 0, 0);
</code></pre>

<p>and incrementing upto <strong>April</strong>. March is showing up with <em>30 days instead of 31</em>. Using <code>date.toString</code> before and after using <code>calendar.add(...)</code> I get the following trimmed output:</p>

<pre><code>YEAR=2012,MONTH=3,WEEK_OF_YEAR=17,WEEK_OF_MONTH=4,DAY_OF_MONTH=28,DAY_OF_YEAR=119,DAY_OF_WEEK=7,DAY_OF_WEEK_IN_MONTH=4,AM_PM=0,HOUR=0
YEAR=2012,MONTH=3,WEEK_OF_YEAR=18,WEEK_OF_MONTH=5,DAY_OF_MONTH=29,DAY_OF_YEAR=120,DAY_OF_WEEK=1,DAY_OF_WEEK_IN_MONTH=5,AM_PM=0,HOUR=0


YEAR=2012,MONTH=3,WEEK_OF_YEAR=18,WEEK_OF_MONTH=5,DAY_OF_MONTH=29,DAY_OF_YEAR=120,DAY_OF_WEEK=1,DAY_OF_WEEK_IN_MONTH=5,AM_PM=0,HOUR=0
YEAR=2012,MONTH=3,WEEK_OF_YEAR=18,WEEK_OF_MONTH=5,DAY_OF_MONTH=30,DAY_OF_YEAR=121,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=5,AM_PM=0,HOUR=0

YEAR=2012,MONTH=3,WEEK_OF_YEAR=18,WEEK_OF_MONTH=5,DAY_OF_MONTH=30,DAY_OF_YEAR=121,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=5,AM_PM=0,HOUR=0
YEAR=2012,MONTH=4,WEEK_OF_YEAR=18,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=122,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0

YEAR=2012,MONTH=4,WEEK_OF_YEAR=18,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=122,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0
YEAR=2012,MONTH=4,WEEK_OF_YEAR=18,WEEK_OF_MONTH=1,DAY_OF_MONTH=2,DAY_OF_YEAR=123,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0
</code></pre>

<p>Above, where <code>MONTH</code> changes from 3 to 4, <code>DAY_OF_MONTH</code> changes from 30 to 1.</p>

<p>Can anyone tell me what is happening here <em>to get March with 30 days</em>?</p>

<h1>update</h1>

<p>Nevermind, got it. Month is zero indexed! Sorry, didn't read enough.</p>
