title: Invalid value 0 for Month field. while converting util.date to XMLgregoriandate?
body: <p>I am converting java.util.Date to XMLGregorianDate.</p>
  
  <p>When I print My util date on console, it displays: </p>
  
  <blockquote>
    <p>Date:  2011-01-25 20:33:46.54</p>
  </blockquote>
  
  <p>But after conversion, when I try to use it, gives me following exception:
  org.springframework.ws.soap.client.SoapFaultClientException: Invalid value 0 for Month field.</p>
  
  <pre><code>Code for Date conversion is:
   DatatypeFactory df = null;
  
                      try {
                          df = DatatypeFactory.newInstance();
                      } catch (DatatypeConfigurationException e) {
                          e.printStackTrace();
                      }
  
              GregorianCalendar gc = new GregorianCalendar();
              gc.setTimeInMillis(account.getCreationDate().getTime());
  
  method returns: df.newXMLGregorianCalendar(gc);
  </code></pre>
  
  <p>Also Interesting thing is that, when I display  util Date.getYear() and getMonth() methods (deprecated method used just to display date on console), output on console was: </p>
  
  <blockquote>
    <p>Year: 111 Month: 0</p>
  </blockquote>
  
  <p>Why this is happening? Can anyone tell reason behind this?
  Thank you in advance.</p>