title: Date to XMLGregorianCalendar conversion giving wrong results
body: <p>I have a code snippet that will convert <code>Date</code> to <code>XMLGregorianCalendar</code>, but after seeing the results dates are different. Not sure why change in dates after conversions.</p>
  
  <p>Code:</p>
  
  <pre><code>public void getDate() throws ParseException {
  
          Date current = null;
          String str = "1980-10-26";
          DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
          Date current1 = format.parse(str);      
          XMLGregorianCalendar xmlCalendar = null;
          xmlCalendar = Utility.convertDateToXMLGreCal(current1);     
          System.out.println("xmlCalendar: "+xmlCalendar);
          current = Utility.convertXMLGreClndrToDate(xmlCalendar);
          System.out.println("current1: "+current.toString());
      }
  
  
  
  public static XMLGregorianCalendar convertDateToXMLGreCal(final Date date){
  
          TimeZone zone = TimeZone.getTimeZone("UTC");
          GregorianCalendar gregoClndr = new GregorianCalendar(zone);
          gregoClndr.setTime(date);
          XMLGregorianCalendar xmlGreClndr = null;
          try {
              final DatatypeFactory dataTypeFactory = DatatypeFactory.newInstance();
              xmlGreClndr = dataTypeFactory.newXMLGregorianCalendar(gregoClndr);
  
          } catch (DatatypeConfigurationException e) {
  
          }
          return xmlGreClndr;
      }
  </code></pre>
  
  <p>*</p>
  
  <p>Results:</p>
  
  <pre>
  xmlCalendar: 1980-10-25T18:30:00.000Z
  current1: Sun Oct 26 00:00:00 IST 1980
  </pre>
  
  <p>I am expecting <code>xmlCalendar</code> as <code>1980-10-26T00:00:00.000Z</code>.</p>
  
  <p>Can someone let me know how to do that?</p>