title: Why does SimpleDateFormat() return wrong month?
body: <p>The following code gives the wrong information:</p>
  
  <pre><code>import java.text.SimpleDateFormat;
  import java.util.GregorianCalendar;
  
  public class test {
  
      public static void main(String[] args) {
  
          GregorianCalendar fmt = new GregorianCalendar(2000, 7, 3);
          SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
          String result = df.format(fmt.getTime());
  
          System.out.println("fmt: " + result);
  
      }
  }
  </code></pre>
  
  <p>It outputs:</p>
  
  <blockquote>
    <p>fmt: 03-Aug-2000</p>
  </blockquote>
  
  <p>While I need the Month to be July, as I have set the month to 7?</p>