title: Why does Java's Date.getYear() return 111 instead of 2011?
body: <p>I am having a bit of trouble parsing a string date to a <code>Date</code> object. I use a <code>DateFormat</code> to parse the string, and when I print the value of the date, it gives me what I expect.</p>
  
  <p>But when I try get the day, the month or the year it gives me the wrong values. For instance, the year is 2011, but when I do <code>.getYear()</code> it gives me 111. I have no idea why this is happening. Here is the relevant code segment:</p>
  
  <pre><code>    Date dateFrom = null;
  
      String gDFString = g.getDateFrom();
  
      System.out.println(gDFString);
  
      DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
  
      try {
          dateFrom = df.parse("04/12/2011");
  
          System.out.println(dateFrom);
  
          System.out.println(dateFrom.getYear());
      } catch (ParseException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>When I out print <code>dateFrom</code>, I get <code>Sun Dec 04 00:00:00 GMT 2011</code>, which is what you would expect. But printing <code>.getYear()</code> returns <code>111</code>.</p>
  
  <p>I need to be able to get the day, month and year of the date for a time series graph.</p>